StreamingCommunity 3.3.3__py3-none-any.whl → 3.3.6__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.

Files changed (45) hide show
  1. StreamingCommunity/Api/Site/altadefinizione/__init__.py +17 -18
  2. StreamingCommunity/Api/Site/altadefinizione/series.py +4 -0
  3. StreamingCommunity/Api/Site/animeunity/__init__.py +14 -15
  4. StreamingCommunity/Api/Site/animeunity/serie.py +1 -1
  5. StreamingCommunity/Api/Site/animeworld/__init__.py +15 -13
  6. StreamingCommunity/Api/Site/animeworld/serie.py +1 -1
  7. StreamingCommunity/Api/Site/crunchyroll/__init__.py +16 -17
  8. StreamingCommunity/Api/Site/crunchyroll/series.py +6 -1
  9. StreamingCommunity/Api/Site/guardaserie/__init__.py +17 -19
  10. StreamingCommunity/Api/Site/guardaserie/series.py +4 -0
  11. StreamingCommunity/Api/Site/guardaserie/site.py +2 -7
  12. StreamingCommunity/Api/Site/mediasetinfinity/__init__.py +15 -15
  13. StreamingCommunity/Api/Site/mediasetinfinity/series.py +4 -0
  14. StreamingCommunity/Api/Site/mediasetinfinity/site.py +12 -2
  15. StreamingCommunity/Api/Site/mediasetinfinity/util/ScrapeSerie.py +67 -98
  16. StreamingCommunity/Api/Site/raiplay/__init__.py +15 -15
  17. StreamingCommunity/Api/Site/raiplay/series.py +5 -1
  18. StreamingCommunity/Api/Site/streamingcommunity/__init__.py +16 -14
  19. StreamingCommunity/Api/Site/streamingwatch/__init__.py +12 -12
  20. StreamingCommunity/Api/Site/streamingwatch/series.py +4 -0
  21. StreamingCommunity/Api/Template/Class/SearchType.py +0 -1
  22. StreamingCommunity/Api/Template/Util/manage_ep.py +1 -11
  23. StreamingCommunity/Api/Template/site.py +2 -3
  24. StreamingCommunity/Lib/Downloader/DASH/decrypt.py +4 -1
  25. StreamingCommunity/Lib/Downloader/DASH/downloader.py +55 -17
  26. StreamingCommunity/Lib/Downloader/DASH/segments.py +73 -17
  27. StreamingCommunity/Lib/Downloader/HLS/downloader.py +282 -152
  28. StreamingCommunity/Lib/Downloader/HLS/segments.py +1 -5
  29. StreamingCommunity/Lib/FFmpeg/capture.py +1 -1
  30. StreamingCommunity/Lib/FFmpeg/command.py +6 -6
  31. StreamingCommunity/Lib/FFmpeg/util.py +11 -30
  32. StreamingCommunity/Lib/M3U8/estimator.py +27 -13
  33. StreamingCommunity/Upload/update.py +2 -2
  34. StreamingCommunity/Upload/version.py +1 -1
  35. StreamingCommunity/Util/installer/__init__.py +11 -0
  36. StreamingCommunity/Util/installer/device_install.py +1 -1
  37. StreamingCommunity/Util/os.py +2 -6
  38. StreamingCommunity/Util/table.py +40 -8
  39. StreamingCommunity/run.py +15 -8
  40. {streamingcommunity-3.3.3.dist-info → streamingcommunity-3.3.6.dist-info}/METADATA +38 -51
  41. {streamingcommunity-3.3.3.dist-info → streamingcommunity-3.3.6.dist-info}/RECORD +45 -44
  42. {streamingcommunity-3.3.3.dist-info → streamingcommunity-3.3.6.dist-info}/WHEEL +0 -0
  43. {streamingcommunity-3.3.3.dist-info → streamingcommunity-3.3.6.dist-info}/entry_points.txt +0 -0
  44. {streamingcommunity-3.3.3.dist-info → streamingcommunity-3.3.6.dist-info}/licenses/LICENSE +0 -0
  45. {streamingcommunity-3.3.3.dist-info → streamingcommunity-3.3.6.dist-info}/top_level.txt +0 -0
@@ -2,7 +2,6 @@
2
2
 
3
3
  import sys
4
4
  import subprocess
5
- from urllib.parse import quote_plus
6
5
 
7
6
 
8
7
  # External library
@@ -101,10 +100,13 @@ def process_search_result(select_title, selections=None):
101
100
  episode_selection = selections.get('episode')
102
101
 
103
102
  download_series(select_title, season_selection, episode_selection)
103
+ media_search_manager.clear()
104
+ table_show_manager.clear()
104
105
  return True
105
106
 
106
107
  else:
107
108
  download_film(select_title)
109
+ table_show_manager.clear()
108
110
  return True
109
111
 
110
112
  # search("Game of Thrones", selections={"season": "1", "episode": "1-3"})
@@ -122,40 +124,37 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
122
124
  bot = None
123
125
  if site_constant.TELEGRAM_BOT:
124
126
  bot = get_bot_instance()
125
-
127
+
126
128
  if direct_item:
127
129
  select_title = MediaItem(**direct_item)
128
- process_search_result(select_title, selections)
129
- return True
130
-
130
+ result = process_search_result(select_title, selections)
131
+ return result
132
+
131
133
  # Get the user input for the search term
132
134
  actual_search_query = get_user_input(string_to_search)
133
135
 
134
- # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
136
+ # Handle empty input
135
137
  if not actual_search_query:
136
138
  if bot:
137
- if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
139
+ if actual_search_query is None:
138
140
  bot.send_message("Search term not provided or operation cancelled. Returning.", None)
139
- return
140
-
141
- # Perform the database search
142
- len_database = title_search(quote_plus(actual_search_query))
141
+ return False
142
+
143
+ # Search on database
144
+ len_database = title_search(actual_search_query)
143
145
 
144
146
  # If only the database is needed, return the manager
145
147
  if get_onlyDatabase:
146
148
  return media_search_manager
147
-
149
+
148
150
  if len_database > 0:
149
151
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
150
- process_search_result(select_title, selections)
151
- return True
152
+ result = process_search_result(select_title, selections)
153
+ return result
152
154
 
153
155
  else:
154
156
  if bot:
155
157
  bot.send_message(f"No results found for: '{actual_search_query}'", None)
156
158
  else:
157
159
  console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
158
-
159
- # Do not call search() recursively here to avoid infinite loops on no results.
160
- # The flow should return to the caller (e.g., main menu in run.py).
161
- return
160
+ return False
@@ -109,6 +109,10 @@ def download_episode(index_season_selected: int, scrape_serie: GetSerieInfo, dow
109
109
  episodes = scrape_serie.getEpisodeSeasons(index_season_selected)
110
110
  episodes_count = len(episodes)
111
111
 
112
+ if episodes_count == 0:
113
+ console.print(f"[red]No episodes found for season {index_season_selected}")
114
+ return
115
+
112
116
  if download_all:
113
117
  for i_episode in range(1, episodes_count + 1):
114
118
  path, stopped = download_video(index_season_selected, i_episode, scrape_serie)
@@ -104,6 +104,8 @@ def process_search_result(select_title, selections=None):
104
104
  episode_selection = selections.get('episode')
105
105
 
106
106
  download_series(select_title, season_selection, episode_selection)
107
+ media_search_manager.clear()
108
+ table_show_manager.clear()
107
109
  return True
108
110
 
109
111
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
@@ -120,40 +122,37 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
120
122
  bot = None
121
123
  if site_constant.TELEGRAM_BOT:
122
124
  bot = get_bot_instance()
123
-
125
+
124
126
  if direct_item:
125
127
  select_title = MediaItem(**direct_item)
126
- process_search_result(select_title, selections)
127
- return True
128
+ result = process_search_result(select_title, selections)
129
+ return result
128
130
 
129
131
  # Get the user input for the search term
130
132
  actual_search_query = get_user_input(string_to_search)
131
133
 
132
- # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
134
+ # Handle empty input
133
135
  if not actual_search_query:
134
136
  if bot:
135
- if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
137
+ if actual_search_query is None:
136
138
  bot.send_message("Search term not provided or operation cancelled. Returning.", None)
137
- return
138
-
139
- # Perform the database search
139
+ return False
140
+
141
+ # Search on database
140
142
  len_database = title_search(actual_search_query)
141
143
 
142
144
  # If only the database is needed, return the manager
143
145
  if get_onlyDatabase:
144
146
  return media_search_manager
145
-
147
+
146
148
  if len_database > 0:
147
149
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
148
- process_search_result(select_title, selections)
149
- return True
150
+ result = process_search_result(select_title, selections)
151
+ return result
150
152
 
151
153
  else:
152
154
  if bot:
153
155
  bot.send_message(f"No results found for: '{actual_search_query}'", None)
154
156
  else:
155
157
  console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
156
-
157
- # Do not call search() recursively here to avoid infinite loops on no results.
158
- # The flow should return to the caller (e.g., main menu in run.py).
159
- return
158
+ return False
@@ -48,7 +48,7 @@ def download_episode(index_select: int, scrape_serie: ScrapeSerieAnime, video_so
48
48
 
49
49
  # Get episode information
50
50
  obj_episode = scrape_serie.selectEpisode(1, index_select)
51
- console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] ([cyan]E{obj_episode.number}[/cyan]) \n")
51
+ console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{scrape_serie.series_name}[/cyan] ([cyan]E{obj_episode.number}[/cyan]) \n")
52
52
 
53
53
  if site_constant.TELEGRAM_BOT:
54
54
  bot = get_bot_instance()
@@ -95,11 +95,15 @@ def process_search_result(select_title, selections=None):
95
95
  episode_selection = None
96
96
  if selections:
97
97
  episode_selection = selections.get('episode')
98
+
98
99
  download_series(select_title, episode_selection)
100
+ media_search_manager.clear()
101
+ table_show_manager.clear()
99
102
  return True
100
103
 
101
104
  else:
102
105
  download_film(select_title)
106
+ table_show_manager.clear()
103
107
  return True
104
108
 
105
109
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
@@ -119,36 +123,34 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
119
123
 
120
124
  if direct_item:
121
125
  select_title = MediaItem(**direct_item)
122
- process_search_result(select_title, selections)
123
- return True
124
-
126
+ result = process_search_result(select_title, selections)
127
+ return result
128
+
125
129
  # Get the user input for the search term
126
130
  actual_search_query = get_user_input(string_to_search)
127
131
 
128
- # Perform the database search
132
+ # Handle empty input
129
133
  if not actual_search_query:
130
134
  if bot:
131
135
  if actual_search_query is None:
132
136
  bot.send_message("Search term not provided or operation cancelled. Returning.", None)
133
- return
137
+ return False
134
138
 
139
+ # Search on database
135
140
  len_database = title_search(actual_search_query)
136
141
 
137
142
  # If only the database is needed, return the manager
138
143
  if get_onlyDatabase:
139
144
  return media_search_manager
140
-
145
+
141
146
  if len_database > 0:
142
147
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
143
- process_search_result(select_title, selections)
144
- return True
145
-
148
+ result = process_search_result(select_title, selections)
149
+ return result
150
+
146
151
  else:
147
152
  if bot:
148
153
  bot.send_message(f"No results found for: '{actual_search_query}'", None)
149
154
  else:
150
155
  console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
151
-
152
- # Do not call search() recursively here to avoid infinite loops on no results.
153
- # The flow should return to the caller (e.g., main menu in run.py).
154
- return
156
+ return False
@@ -47,7 +47,7 @@ def download_episode(index_select: int, scrape_serie: ScrapSerie) -> Tuple[str,b
47
47
 
48
48
  # Get episode information
49
49
  episode_data = scrape_serie.selectEpisode(1, index_select)
50
- console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] ([cyan]E{index_select+1}[/cyan]) \n")
50
+ console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{scrape_serie.get_name()}[/cyan] ([cyan]E{str(index_select+1)}[/cyan]) \n")
51
51
 
52
52
  # Define filename and path for the downloaded video
53
53
  mp4_name = f"{scrape_serie.get_name()}_EP_{dynamic_format_number(str(index_select+1))}.mp4"
@@ -2,7 +2,6 @@
2
2
 
3
3
  import sys
4
4
  import subprocess
5
- from urllib.parse import quote_plus
6
5
 
7
6
 
8
7
  # External library
@@ -101,10 +100,13 @@ def process_search_result(select_title, selections=None):
101
100
  episode_selection = selections.get('episode')
102
101
 
103
102
  download_series(select_title, season_selection, episode_selection)
103
+ media_search_manager.clear()
104
+ table_show_manager.clear()
104
105
  return True
105
106
 
106
107
  else:
107
108
  download_film(select_title)
109
+ table_show_manager.clear()
108
110
  return True
109
111
 
110
112
  # search("Game of Thrones", selections={"season": "1", "episode": "1-3"})
@@ -122,40 +124,37 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
122
124
  bot = None
123
125
  if site_constant.TELEGRAM_BOT:
124
126
  bot = get_bot_instance()
125
-
127
+
126
128
  if direct_item:
127
129
  select_title = MediaItem(**direct_item)
128
- process_search_result(select_title, selections)
129
- return True
130
+ result = process_search_result(select_title, selections)
131
+ return result
130
132
 
131
133
  # Get the user input for the search term
132
134
  actual_search_query = get_user_input(string_to_search)
133
135
 
134
- # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
136
+ # Handle empty input
135
137
  if not actual_search_query:
136
138
  if bot:
137
- if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
139
+ if actual_search_query is None:
138
140
  bot.send_message("Search term not provided or operation cancelled. Returning.", None)
139
- return
140
-
141
- # Perform the database search
142
- len_database = title_search(quote_plus(actual_search_query))
141
+ return False
142
+
143
+ # Search on database
144
+ len_database = title_search(actual_search_query)
143
145
 
144
146
  # If only the database is needed, return the manager
145
147
  if get_onlyDatabase:
146
148
  return media_search_manager
147
-
149
+
148
150
  if len_database > 0:
149
151
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
150
- process_search_result(select_title, selections)
151
- return True
152
+ result = process_search_result(select_title, selections)
153
+ return result
152
154
 
153
155
  else:
154
156
  if bot:
155
157
  bot.send_message(f"No results found for: '{actual_search_query}'", None)
156
158
  else:
157
159
  console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
158
-
159
- # Do not call search() recursively here to avoid infinite loops on no results.
160
- # The flow should return to the caller (e.g., main menu in run.py).
161
- return
160
+ return False
@@ -55,7 +55,8 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
55
55
 
56
56
  # Get episode information
57
57
  obj_episode = scrape_serie.selectEpisode(index_season_selected, index_episode_selected-1)
58
- console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [bold magenta]{obj_episode.get('name')}[/bold magenta] ([cyan]S{index_season_selected}E{index_episode_selected}[/cyan]) \n")
58
+
59
+ console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{scrape_serie.series_name}[/cyan] \\ [bold magenta]{obj_episode.get('name')}[/bold magenta] ([cyan]S{index_season_selected}E{index_episode_selected}[/cyan]) \n")
59
60
 
60
61
  # Define filename and path for the downloaded video
61
62
  mp4_name = f"{map_episode_title(scrape_serie.series_name, index_season_selected, index_episode_selected, obj_episode.get('name'))}.mp4"
@@ -117,6 +118,10 @@ def download_episode(index_season_selected: int, scrape_serie: GetSerieInfo, dow
117
118
  episodes = scrape_serie.getEpisodeSeasons(index_season_selected)
118
119
  episodes_count = len(episodes)
119
120
 
121
+ if episodes_count == 0:
122
+ console.print(f"[red]No episodes found for season {index_season_selected}")
123
+ return
124
+
120
125
  if download_all:
121
126
  for i_episode in range(1, episodes_count + 1):
122
127
  path, stopped = download_video(index_season_selected, i_episode, scrape_serie)
@@ -99,6 +99,8 @@ def process_search_result(select_title, selections=None):
99
99
  episode_selection = selections.get('episode')
100
100
 
101
101
  download_series(select_title, season_selection, episode_selection)
102
+ media_search_manager.clear()
103
+ table_show_manager.clear()
102
104
  return True
103
105
 
104
106
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
@@ -114,42 +116,38 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
114
116
  """
115
117
  bot = None
116
118
  if site_constant.TELEGRAM_BOT:
117
- try:
118
- from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
119
- bot = get_bot_instance()
120
- except Exception:
121
- bot = None
122
-
119
+ bot = get_bot_instance()
120
+
123
121
  if direct_item:
124
122
  select_title = MediaItem(**direct_item)
125
- process_search_result(select_title, selections)
126
- return True
127
-
123
+ result = process_search_result(select_title, selections)
124
+ return result
125
+
128
126
  # Get the user input for the search term
129
127
  actual_search_query = get_user_input(string_to_search)
130
-
128
+
131
129
  # Handle empty input
132
130
  if not actual_search_query:
133
131
  if bot:
134
132
  if actual_search_query is None:
135
133
  bot.send_message("Search term not provided or operation cancelled. Returning.", None)
136
- return
137
-
138
- # Search on database (preserve quote_plus usage)
134
+ return False
135
+
136
+ # Search on database
139
137
  len_database = title_search(quote_plus(actual_search_query))
140
-
138
+
141
139
  # If only the database is needed, return the manager
142
140
  if get_onlyDatabase:
143
141
  return media_search_manager
144
-
142
+
145
143
  if len_database > 0:
146
144
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
147
- process_search_result(select_title, selections)
148
- return True
149
-
145
+ result = process_search_result(select_title, selections)
146
+ return result
147
+
150
148
  else:
151
149
  if bot:
152
150
  bot.send_message(f"No results found for: '{actual_search_query}'", None)
153
151
  else:
154
152
  console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
155
- return
153
+ return False
@@ -96,6 +96,10 @@ def download_episode(scape_info_serie: GetSerieInfo, index_season_selected: int,
96
96
  episodes = scape_info_serie.get_episode_number(index_season_selected)
97
97
  episodes_count = len(episodes)
98
98
 
99
+ if episodes_count == 0:
100
+ console.print(f"[red]No episodes found for season {index_season_selected}")
101
+ return
102
+
99
103
  if download_all:
100
104
 
101
105
  # Download all episodes in the season
@@ -59,17 +59,12 @@ def title_search(query: str) -> int:
59
59
 
60
60
  for serie_div in soup.find_all('div', class_='entry'):
61
61
  try:
62
-
63
- title = serie_div.find('a').get("title")
64
- link = serie_div.find('a').get("href")
65
-
66
62
  serie_info = {
67
- 'name': title.replace("streaming guardaserie", ""),
68
- 'url': link,
63
+ 'name': serie_div.find('a').get("title").replace("streaming guardaserie", ""),
64
+ 'url': serie_div.find('a').get("href"),
69
65
  'type': 'tv',
70
66
  'image': f"{site_constant.FULL_URL}/{serie_div.find('img').get('src')}",
71
67
  }
72
-
73
68
  media_search_manager.add_media(serie_info)
74
69
 
75
70
  except Exception as e:
@@ -100,10 +100,13 @@ def process_search_result(select_title, selections=None):
100
100
  episode_selection = selections.get('episode')
101
101
 
102
102
  download_series(select_title, season_selection, episode_selection)
103
+ media_search_manager.clear()
104
+ table_show_manager.clear()
103
105
  return True
104
106
 
105
107
  else:
106
108
  download_film(select_title)
109
+ table_show_manager.clear()
107
110
  return True
108
111
 
109
112
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
@@ -120,40 +123,37 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
120
123
  bot = None
121
124
  if site_constant.TELEGRAM_BOT:
122
125
  bot = get_bot_instance()
123
-
126
+
124
127
  if direct_item:
125
128
  select_title = MediaItem(**direct_item)
126
- process_search_result(select_title, selections)
127
- return True
129
+ result = process_search_result(select_title, selections)
130
+ return result
128
131
 
129
132
  # Get the user input for the search term
130
133
  actual_search_query = get_user_input(string_to_search)
131
134
 
132
- # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
135
+ # Handle empty input
133
136
  if not actual_search_query:
134
137
  if bot:
135
- if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
138
+ if actual_search_query is None:
136
139
  bot.send_message("Search term not provided or operation cancelled. Returning.", None)
137
- return
138
-
139
- # Perform the database search
140
+ return False
141
+
142
+ # Search on database
140
143
  len_database = title_search(actual_search_query)
141
144
 
142
145
  # If only the database is needed, return the manager
143
146
  if get_onlyDatabase:
144
147
  return media_search_manager
145
-
148
+
146
149
  if len_database > 0:
147
150
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
148
- process_search_result(select_title, selections)
149
- return True
151
+ result = process_search_result(select_title, selections)
152
+ return result
150
153
 
151
154
  else:
152
155
  if bot:
153
156
  bot.send_message(f"No results found for: '{actual_search_query}'", None)
154
157
  else:
155
158
  console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
156
-
157
- # Do not call search() recursively here to avoid infinite loops on no results.
158
- # The flow should return to the caller (e.g., main menu in run.py).
159
- return
159
+ return False
@@ -109,6 +109,10 @@ def download_episode(index_season_selected: int, scrape_serie: GetSerieInfo, dow
109
109
  episodes = scrape_serie.getEpisodeSeasons(index_season_selected)
110
110
  episodes_count = len(episodes)
111
111
 
112
+ if episodes_count == 0:
113
+ console.print(f"[red]No episodes found for season {index_season_selected}")
114
+ return
115
+
112
116
  if download_all:
113
117
  for i_episode in range(1, episodes_count + 1):
114
118
  path, stopped = download_video(index_season_selected, i_episode, scrape_serie)
@@ -2,6 +2,7 @@
2
2
 
3
3
  import os
4
4
  import sys
5
+ from datetime import datetime
5
6
 
6
7
 
7
8
  # External libraries
@@ -118,13 +119,22 @@ def title_search(query: str) -> int:
118
119
  if page_url and page_url.startswith('//'):
119
120
  page_url = f"https:{page_url}"
120
121
 
122
+ date = item.get('year', '')
123
+ if not date and item.get('updated'):
124
+ try:
125
+
126
+ timestamp_ms = int(item.get('updated', 0))
127
+ date = datetime.fromtimestamp(timestamp_ms / 1000).year
128
+ except (ValueError, TypeError):
129
+ date = ''
130
+
121
131
  media_search_manager.add_media({
122
132
  'id': item.get('guid', '') or item.get('_id', ''),
123
133
  'name': item.get('title', ''),
124
134
  'type': media_type,
125
135
  'url': page_url,
126
- 'image': item.get('thumbnails', {}).get('image_header_poster-768x384', '').get('url', ''),
127
- 'date': item.get('year', ''),
136
+ 'image': next(iter(item.get('thumbnails', {}).values()), {}).get('url', ''),
137
+ 'date': date,
128
138
  })
129
139
 
130
140
  return media_search_manager.get_length()