mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-07-19 16:40:01 +00:00
Update maxstream.py
This commit is contained in:
parent
15d9bf9c61
commit
fb87131777
@ -39,7 +39,7 @@ class VideoSource:
|
|||||||
Sends a request to the initial URL and extracts the redirect URL.
|
Sends a request to the initial URL and extracts the redirect URL.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
response = httpx.get(self.url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
response = httpx.get(self.url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
# Extract the redirect URL from the HTML
|
# Extract the redirect URL from the HTML
|
||||||
@ -58,7 +58,7 @@ class VideoSource:
|
|||||||
Sends a request to the redirect URL and extracts the Maxstream URL.
|
Sends a request to the redirect URL and extracts the Maxstream URL.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
response = httpx.get(self.redirect_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
response = httpx.get(self.redirect_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
# Extract the Maxstream URL from the HTML
|
# Extract the Maxstream URL from the HTML
|
||||||
@ -77,12 +77,12 @@ class VideoSource:
|
|||||||
|
|
||||||
# Make request to stayonline api
|
# Make request to stayonline api
|
||||||
data = {'id': self.redirect_url.split("/")[-2], 'ref': ''}
|
data = {'id': self.redirect_url.split("/")[-2], 'ref': ''}
|
||||||
response = httpx.post('https://stayonline.pro/ajax/linkEmbedView.php', headers=headers, data=data)
|
response = httpx.post('https://stayonline.pro/ajax/linkEmbedView.php', headers=headers, data=data, verify=REQUEST_VERIFY)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
uprot_url = response.json()['data']['value']
|
uprot_url = response.json()['data']['value']
|
||||||
|
|
||||||
# Retry getting maxtstream url
|
# Retry getting maxtstream url
|
||||||
response = httpx.get(uprot_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
response = httpx.get(uprot_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
soup = BeautifulSoup(response.text, "html.parser")
|
soup = BeautifulSoup(response.text, "html.parser")
|
||||||
maxstream_url = soup.find("a").get("href")
|
maxstream_url = soup.find("a").get("href")
|
||||||
@ -104,7 +104,7 @@ class VideoSource:
|
|||||||
Sends a request to the Maxstream URL and extracts the .m3u8 file URL.
|
Sends a request to the Maxstream URL and extracts the .m3u8 file URL.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
response = httpx.get(self.maxstream_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
response = httpx.get(self.maxstream_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
soup = BeautifulSoup(response.text, "html.parser")
|
soup = BeautifulSoup(response.text, "html.parser")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user