Skip to content

Commit cff315d

Browse files
committed
v2
1 parent d43f267 commit cff315d

File tree

30 files changed

+1876
-1476
lines changed

30 files changed

+1876
-1476
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ working_proxies.json
5656
start.sh
5757
.DS_Store
5858
GUI/db.sqlite3
59-
console.log
59+
console.log
60+
/.github/script/domains.json
61+
/.cache

StreamingCommunity/Api/Player/vixcloud.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,32 @@ def parse(cls, js_string):
193193

194194

195195
class VideoSource:
196-
def __init__(self, url: str, is_series: bool, media_id: int = None):
196+
def __init__(self, url: str, is_series: bool, media_id: int = None, tmdb_data: Dict[str, Any] = None):
197197
"""
198198
Initialize video source for streaming site.
199199
200200
Args:
201201
- url (str): The URL of the streaming site.
202202
- is_series (bool): Flag for series or movie content
203203
- media_id (int, optional): Unique identifier for media item
204+
- tmdb_data (dict, optional): TMDB data with 'id', 's' (season), 'e' (episode)
204205
"""
205206
self.headers = {'user-agent': get_userAgent()}
206207
self.url = url
207208
self.is_series = is_series
208209
self.media_id = media_id
209210
self.iframe_src = None
210211
self.window_parameter = None
212+
213+
# Store TMDB data if provided
214+
if tmdb_data is not None:
215+
self.tmdb_id = tmdb_data.get('id')
216+
self.season_number = tmdb_data.get('s')
217+
self.episode_number = tmdb_data.get('e')
218+
else:
219+
self.tmdb_id = None
220+
self.season_number = None
221+
self.episode_number = None
211222

212223
def get_iframe(self, episode_id: int) -> None:
213224
"""
@@ -259,13 +270,18 @@ def parse_script(self, script_text: str) -> None:
259270
def get_content(self) -> None:
260271
"""
261272
Fetch and process video content from iframe source.
262-
263-
Workflow:
264-
- Validate iframe source
265-
- Retrieve content
266-
- Parse embedded script
267273
"""
268274
try:
275+
# If TMDB ID is provided, use direct vixsrc.to URL
276+
if self.tmdb_id is not None:
277+
console.print("[red]Using API V.2")
278+
if self.is_series:
279+
if self.season_number is not None and self.episode_number is not None:
280+
self.iframe_src = f"https://vixsrc.to/tv/{self.tmdb_id}/{self.season_number}/{self.episode_number}/?lang=it"
281+
else:
282+
self.iframe_src = f"https://vixsrc.to/movie/{self.tmdb_id}/?lang=it"
283+
284+
# Fetch content from iframe source
269285
if self.iframe_src is not None:
270286
response = create_client(headers=self.headers).get(self.iframe_src)
271287
response.raise_for_status()
@@ -357,4 +373,4 @@ def get_embed(self, episode_id: int):
357373

358374
except Exception as e:
359375
logging.error(f"Error fetching embed URL: {e}")
360-
return None
376+
return None

StreamingCommunity/Api/Service/crunchyroll/site.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def title_search(query: str) -> int:
3535

3636
config = config_manager.get_dict("SITE_LOGIN", "crunchyroll")
3737
if not config.get('device_id') or not config.get('etp_rt'):
38-
console.print("[red] device_id or etp_rt is missing or empty in config.json.")
3938
raise Exception("device_id or etp_rt is missing or empty in config.json.")
4039

4140
client = CrunchyrollClient()

0 commit comments

Comments
 (0)