mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-07-21 09:30:02 +00:00
Bump v2.9.0.
This commit is contained in:
parent
dd1e8364d3
commit
9c84eb665c
@ -55,10 +55,8 @@ def download_film(select_title: MediaItem) -> str:
|
||||
output_path=os.path.join(mp4_path, title_name)
|
||||
).start()
|
||||
|
||||
if "error" in r_proc.keys():
|
||||
try:
|
||||
os.remove(r_proc['path'])
|
||||
except:
|
||||
pass
|
||||
if r_proc['error'] is not None:
|
||||
try: os.remove(r_proc['path'])
|
||||
except: pass
|
||||
|
||||
return r_proc['path']
|
@ -73,12 +73,9 @@ def download_video(index_season_selected: int, index_episode_selected: int, scap
|
||||
output_path=os.path.join(mp4_path, mp4_name)
|
||||
).start()
|
||||
|
||||
|
||||
if "error" in r_proc.keys():
|
||||
try:
|
||||
os.remove(r_proc['path'])
|
||||
except:
|
||||
pass
|
||||
if r_proc['error'] is not None:
|
||||
try: os.remove(r_proc['path'])
|
||||
except: pass
|
||||
|
||||
return r_proc['path'], r_proc['stopped']
|
||||
|
||||
|
@ -86,10 +86,8 @@ def download_film(movie_details: Json_film) -> str:
|
||||
output_path=os.path.join(mp4_path, title_name)
|
||||
).start()
|
||||
|
||||
if "error" in r_proc.keys():
|
||||
try:
|
||||
os.remove(r_proc['path'])
|
||||
except:
|
||||
pass
|
||||
if r_proc['error'] is not None:
|
||||
try: os.remove(r_proc['path'])
|
||||
except: pass
|
||||
|
||||
return r_proc['path']
|
@ -80,10 +80,8 @@ def download_film(select_title: MediaItem) -> str:
|
||||
if script_id != "unknown":
|
||||
TelegramSession.deleteScriptId(script_id)
|
||||
|
||||
if "error" in r_proc.keys():
|
||||
try:
|
||||
os.remove(r_proc['path'])
|
||||
except:
|
||||
pass
|
||||
if r_proc['error'] is not None:
|
||||
try: os.remove(r_proc['path'])
|
||||
except: pass
|
||||
|
||||
return r_proc['path']
|
@ -86,11 +86,9 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
|
||||
output_path=os.path.join(mp4_path, mp4_name)
|
||||
).start()
|
||||
|
||||
if "error" in r_proc.keys():
|
||||
try:
|
||||
os.remove(r_proc['path'])
|
||||
except:
|
||||
pass
|
||||
if r_proc['error'] is not None:
|
||||
try: os.remove(r_proc['path'])
|
||||
except: pass
|
||||
|
||||
return r_proc['path'], r_proc['stopped']
|
||||
|
||||
|
@ -429,7 +429,8 @@ class HLS_Downloader:
|
||||
'path': self.path_manager.output_path,
|
||||
'url': self.m3u8_url,
|
||||
'is_master': False,
|
||||
'error': 'File already exists',
|
||||
'msg': 'File already exists',
|
||||
'error': None,
|
||||
'stopped': False
|
||||
}
|
||||
if TELEGRAM_BOT:
|
||||
@ -473,6 +474,8 @@ class HLS_Downloader:
|
||||
'path': self.path_manager.output_path,
|
||||
'url': self.m3u8_url,
|
||||
'is_master': self.m3u8_manager.is_master,
|
||||
'msg': None,
|
||||
'error': None,
|
||||
'stopped': download_stopped
|
||||
}
|
||||
|
||||
@ -485,6 +488,7 @@ class HLS_Downloader:
|
||||
'path': None,
|
||||
'url': self.m3u8_url,
|
||||
'is_master': getattr(self.m3u8_manager, 'is_master', None),
|
||||
'msg': None,
|
||||
'error': error_msg,
|
||||
'stopped': False
|
||||
}
|
||||
|
@ -503,25 +503,35 @@ class M3U8_Parser:
|
||||
except Exception as e:
|
||||
logging.error(f"Error parsing video info: {e}")
|
||||
|
||||
def __parse_encryption_keys__(self, m3u8_obj) -> None:
|
||||
def __parse_encryption_keys__(self, obj) -> None:
|
||||
"""
|
||||
Extracts encryption keys from the M3U8 object.
|
||||
Extracts encryption keys either from the M3U8 object or from individual segments.
|
||||
|
||||
Parameters:
|
||||
- m3u8_obj: The M3U8 object containing encryption keys.
|
||||
- obj: Either the main M3U8 object or an individual segment.
|
||||
"""
|
||||
try:
|
||||
if m3u8_obj.key is not None:
|
||||
if self.keys is None:
|
||||
self.keys = {
|
||||
'method': m3u8_obj.key.method,
|
||||
'iv': m3u8_obj.key.iv,
|
||||
'uri': m3u8_obj.key.uri
|
||||
if hasattr(obj, 'key') and obj.key is not None:
|
||||
key_info = {
|
||||
'method': obj.key.method,
|
||||
'iv': obj.key.iv,
|
||||
'uri': obj.key.uri
|
||||
}
|
||||
|
||||
if self.keys is None:
|
||||
self.keys = key_info
|
||||
|
||||
"""
|
||||
elif obj.key.uri not in self.keys:
|
||||
if isinstance(self.keys, dict):
|
||||
self.keys[obj.key.uri] = key_info
|
||||
else:
|
||||
old_key = self.keys
|
||||
self.keys = {'default': old_key, obj.key.uri: key_info}
|
||||
"""
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f"Error parsing encryption keys: {e}")
|
||||
sys.exit(0)
|
||||
pass
|
||||
|
||||
def __parse_subtitles_and_audio__(self, m3u8_obj) -> None:
|
||||
@ -575,6 +585,10 @@ class M3U8_Parser:
|
||||
else:
|
||||
self.subtitle.append(segment.uri)
|
||||
|
||||
# Second check if there is key in main m3u8 obj
|
||||
if self.keys is None:
|
||||
self.__parse_encryption_keys__(m3u8_obj)
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f"Error parsing segments: {e}")
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
__title__ = 'StreamingCommunity'
|
||||
__version__ = '2.8.0'
|
||||
__version__ = '2.9.0'
|
||||
__author__ = 'Arrowar'
|
||||
__description__ = 'A command-line program to download film'
|
||||
__copyright__ = 'Copyright 2024'
|
||||
|
Loading…
x
Reference in New Issue
Block a user