StreamingCommunity 3.0.1__py3-none-any.whl → 3.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of StreamingCommunity might be problematic. Click here for more details.
- StreamingCommunity/Api/Player/hdplayer.py +65 -0
- StreamingCommunity/Api/Player/mixdrop.py +145 -0
- StreamingCommunity/Api/Site/1337xx/site.py +1 -1
- StreamingCommunity/Api/Site/altadefinizione/site.py +1 -1
- StreamingCommunity/Api/Site/animeunity/site.py +2 -1
- StreamingCommunity/Api/Site/animeworld/site.py +1 -1
- StreamingCommunity/Api/Site/ddlstreamitaly/site.py +1 -1
- StreamingCommunity/Api/Site/guardaserie/site.py +1 -1
- StreamingCommunity/Api/Site/raiplay/site.py +2 -2
- StreamingCommunity/Api/Site/streamingcommunity/series.py +2 -2
- StreamingCommunity/Api/Site/streamingcommunity/site.py +1 -1
- StreamingCommunity/Api/Site/streamingwatch/__init__.py +95 -0
- StreamingCommunity/Api/Site/streamingwatch/film.py +61 -0
- StreamingCommunity/Api/Site/streamingwatch/series.py +160 -0
- StreamingCommunity/Api/Site/streamingwatch/site.py +111 -0
- StreamingCommunity/Api/Site/streamingwatch/util/ScrapeSerie.py +118 -0
- StreamingCommunity/Lib/Proxies/proxy.py +232 -0
- StreamingCommunity/Upload/version.py +1 -1
- {streamingcommunity-3.0.1.dist-info → streamingcommunity-3.0.2.dist-info}/METADATA +16 -2
- {streamingcommunity-3.0.1.dist-info → streamingcommunity-3.0.2.dist-info}/RECORD +24 -17
- {streamingcommunity-3.0.1.dist-info → streamingcommunity-3.0.2.dist-info}/WHEEL +1 -1
- StreamingCommunity/Api/Player/maxstream.py +0 -140
- {streamingcommunity-3.0.1.dist-info → streamingcommunity-3.0.2.dist-info}/entry_points.txt +0 -0
- {streamingcommunity-3.0.1.dist-info → streamingcommunity-3.0.2.dist-info}/licenses/LICENSE +0 -0
- {streamingcommunity-3.0.1.dist-info → streamingcommunity-3.0.2.dist-info}/top_level.txt +0 -0
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
# 05.07.24
|
|
2
|
-
|
|
3
|
-
import re
|
|
4
|
-
import logging
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# External libraries
|
|
8
|
-
import httpx
|
|
9
|
-
import jsbeautifier
|
|
10
|
-
from bs4 import BeautifulSoup
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# Internal utilities
|
|
14
|
-
from StreamingCommunity.Util.config_json import config_manager
|
|
15
|
-
from StreamingCommunity.Util.headers import get_userAgent
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# Variable
|
|
19
|
-
MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class VideoSource:
|
|
23
|
-
def __init__(self, url: str):
|
|
24
|
-
"""
|
|
25
|
-
Sets up the video source with the provided URL.
|
|
26
|
-
|
|
27
|
-
Parameters:
|
|
28
|
-
- url (str): The URL of the video.
|
|
29
|
-
"""
|
|
30
|
-
self.url = url
|
|
31
|
-
self.redirect_url = None
|
|
32
|
-
self.maxstream_url = None
|
|
33
|
-
self.m3u8_url = None
|
|
34
|
-
self.headers = {'user-agent': get_userAgent()}
|
|
35
|
-
|
|
36
|
-
def get_redirect_url(self):
|
|
37
|
-
"""
|
|
38
|
-
Sends a request to the initial URL and extracts the redirect URL.
|
|
39
|
-
"""
|
|
40
|
-
try:
|
|
41
|
-
response = httpx.get(self.url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
42
|
-
response.raise_for_status()
|
|
43
|
-
|
|
44
|
-
# Extract the redirect URL from the HTML
|
|
45
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
46
|
-
self.redirect_url = soup.find("div", id="iframen1").get("data-src")
|
|
47
|
-
logging.info(f"Redirect URL: {self.redirect_url}")
|
|
48
|
-
|
|
49
|
-
return self.redirect_url
|
|
50
|
-
|
|
51
|
-
except Exception as e:
|
|
52
|
-
logging.error(f"Error parsing HTML: {e}")
|
|
53
|
-
raise
|
|
54
|
-
|
|
55
|
-
def get_maxstream_url(self):
|
|
56
|
-
"""
|
|
57
|
-
Sends a request to the redirect URL and extracts the Maxstream URL.
|
|
58
|
-
"""
|
|
59
|
-
try:
|
|
60
|
-
response = httpx.get(self.redirect_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
61
|
-
response.raise_for_status()
|
|
62
|
-
|
|
63
|
-
# Extract the Maxstream URL from the HTML
|
|
64
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
65
|
-
maxstream_url = soup.find("a")
|
|
66
|
-
|
|
67
|
-
if maxstream_url is None:
|
|
68
|
-
|
|
69
|
-
# If no anchor tag is found, try the alternative method
|
|
70
|
-
logging.warning("Anchor tag not found. Trying the alternative method.")
|
|
71
|
-
headers = {
|
|
72
|
-
'origin': 'https://stayonline.pro',
|
|
73
|
-
'user-agent': get_userAgent(),
|
|
74
|
-
'x-requested-with': 'XMLHttpRequest',
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
# Make request to stayonline api
|
|
78
|
-
data = {'id': self.redirect_url.split("/")[-2], 'ref': ''}
|
|
79
|
-
response = httpx.post('https://stayonline.pro/ajax/linkEmbedView.php', headers=headers, data=data)
|
|
80
|
-
response.raise_for_status()
|
|
81
|
-
uprot_url = response.json()['data']['value']
|
|
82
|
-
|
|
83
|
-
# Retry getting maxtstream url
|
|
84
|
-
response = httpx.get(uprot_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
85
|
-
response.raise_for_status()
|
|
86
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
87
|
-
maxstream_url = soup.find("a").get("href")
|
|
88
|
-
|
|
89
|
-
else:
|
|
90
|
-
maxstream_url = maxstream_url.get("href")
|
|
91
|
-
|
|
92
|
-
self.maxstream_url = maxstream_url
|
|
93
|
-
logging.info(f"Maxstream URL: {self.maxstream_url}")
|
|
94
|
-
|
|
95
|
-
return self.maxstream_url
|
|
96
|
-
|
|
97
|
-
except Exception as e:
|
|
98
|
-
logging.error(f"Error during the request: {e}")
|
|
99
|
-
raise
|
|
100
|
-
|
|
101
|
-
def get_m3u8_url(self):
|
|
102
|
-
"""
|
|
103
|
-
Sends a request to the Maxstream URL and extracts the .m3u8 file URL.
|
|
104
|
-
"""
|
|
105
|
-
try:
|
|
106
|
-
response = httpx.get(self.maxstream_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
107
|
-
response.raise_for_status()
|
|
108
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
109
|
-
|
|
110
|
-
# Iterate over all script tags in the HTML
|
|
111
|
-
for script in soup.find_all("script"):
|
|
112
|
-
if "eval(function(p,a,c,k,e,d)" in script.text:
|
|
113
|
-
|
|
114
|
-
# Execute the script using
|
|
115
|
-
data_js = jsbeautifier.beautify(script.text)
|
|
116
|
-
|
|
117
|
-
# Extract the .m3u8 URL from the script's output
|
|
118
|
-
match = re.search(r'sources:\s*\[\{\s*src:\s*"([^"]+)"', data_js)
|
|
119
|
-
|
|
120
|
-
if match:
|
|
121
|
-
self.m3u8_url = match.group(1)
|
|
122
|
-
logging.info(f"M3U8 URL: {self.m3u8_url}")
|
|
123
|
-
break
|
|
124
|
-
|
|
125
|
-
else:
|
|
126
|
-
logging.error("Failed to find M3U8 URL: No match found")
|
|
127
|
-
|
|
128
|
-
return self.m3u8_url
|
|
129
|
-
|
|
130
|
-
except Exception as e:
|
|
131
|
-
logging.error(f"Error executing the Node.js script: {e}")
|
|
132
|
-
raise
|
|
133
|
-
|
|
134
|
-
def get_playlist(self):
|
|
135
|
-
"""
|
|
136
|
-
Executes the entire flow to obtain the final .m3u8 file URL.
|
|
137
|
-
"""
|
|
138
|
-
self.get_redirect_url()
|
|
139
|
-
self.get_maxstream_url()
|
|
140
|
-
return self.get_m3u8_url()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|