mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
22 lines
651 B
Python
22 lines
651 B
Python
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) |