mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
accidentally included a pycache
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
from bs4 import BeautifulSoup
|
||||||
|
import requests
|
||||||
|
|
||||||
|
def scrape_buzzheavier(url):
|
||||||
|
|
||||||
|
response = requests.get(url)
|
||||||
|
response.raise_for_status()
|
||||||
|
|
||||||
|
download_url = url + '/download'
|
||||||
|
headers = {
|
||||||
|
'hx-current-url': url,
|
||||||
|
'hx-request': 'true',
|
||||||
|
'referer': url
|
||||||
|
}
|
||||||
|
head_response = requests.head(download_url, headers=headers, allow_redirects=False)
|
||||||
|
hx_redirect = head_response.headers.get('hx-redirect')
|
||||||
|
return hx_redirect
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
example = "https://buzzheavier.com/irzewxdjt5ah"
|
||||||
|
download = scrape_buzzheavier("https://buzzheavier.com/irzewxdjt5ah")
|
||||||
|
print(download)
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import requests
|
||||||
|
import re
|
||||||
|
|
||||||
|
def scrape_gofile(url):
|
||||||
|
|
||||||
|
filetoken = re.findall(r"(?<=https...gofile.io\/d\/).*", url)[0]
|
||||||
|
session = requests.Session()
|
||||||
|
|
||||||
|
acc = session.post("https://api.gofile.io/accounts")
|
||||||
|
token = acc.json()["data"]["token"]
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Authorization": f"Bearer {token}",
|
||||||
|
"X-Website-Token": "4fd6sg89d7s6",
|
||||||
|
}
|
||||||
|
|
||||||
|
r = session.get(
|
||||||
|
f"https://api.gofile.io/contents/{filetoken}",
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
temp: dict = r.json()["data"]["children"]
|
||||||
|
child = [key for key in temp.keys()]
|
||||||
|
|
||||||
|
|
||||||
|
return temp[child[0]]["link"]
|
||||||
|
|
||||||
|
|
||||||
|
out = scrape_gofile("https://gofile.io/d/tvvzAD")
|
||||||
|
print(out)
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import undetected_chromedriver as uc
|
||||||
|
from selenium.webdriver.common.by import By
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
def scrape_vikingfile(url):
|
||||||
|
|
||||||
|
options = uc.ChromeOptions()
|
||||||
|
|
||||||
|
driver = uc.Chrome(options=options, version_main=145)
|
||||||
|
driver.get(url)
|
||||||
|
|
||||||
|
while driver.find_element(By.ID, "download-link").get_attribute("href") is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
link = driver.find_element(By.ID, "download-link").get_attribute("href")
|
||||||
|
|
||||||
|
driver.quit()
|
||||||
|
|
||||||
|
return link
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
example = "https://vik1ngfile.site/f/4txMf0RghN"
|
||||||
|
downloadlink = scrape_vikingfile(example)
|
||||||
|
print(downloadlink)
|
||||||
Reference in New Issue
Block a user