Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
(cherry picked from commit 2127107)
  • Loading branch information
RyanL-29 committed Sep 28, 2024
1 parent 919cd87 commit a5edfb1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions Anime.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,13 @@ def check_no_ad(error_count=10):
sys.exit(1)

def parse_playlist():
req = self._playlist['data']['src']
f = self.__request(req, no_cookies=True, addition_header={'origin': 'https://ani.gamer.com.tw'})
url_prefix = re.sub(r'playlist.+', '', self._playlist['data']['src']) # m3u8 URL 前缀
playlist_url = ""
if self._settings['use_mobile_api']:
playlist_url = self._playlist['data']['src']
else:
playlist_url = self._playlist['src']
f = self.__request(playlist_url, no_cookies=True, addition_header={'origin': 'https://ani.gamer.com.tw'})
url_prefix = re.sub(r'playlist.+', '', playlist_url) # m3u8 URL 前缀
m3u8_list = re.findall(r'=\d+x\d+\n.+', f.content.decode()) # 将包含分辨率和 m3u8 文件提取
m3u8_dict = {}
for i in m3u8_list:
Expand Down
8 changes: 4 additions & 4 deletions aniGamerPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,10 @@ def __cui(sn, cui_resolution, cui_download_mode, cui_thread_limit, ep_range,
tasks_counter = 0
for anime_db in ep_range:
if anime_db["status"] == 1:
if not anime_db["anime_name"] is None \
and not anime_db["local_file_path"] is None :
if anime_db["anime_name"] is not None \
and anime_db["local_file_path"] is not None :
a = threading.Thread(target=__get_danmu_only,args=(anime_db["sn"], anime_db["anime_name"], anime_db["local_file_path"]))
a.setDaemon(True)
a.daemon = True
thread_tasks.append(a)
a.start()
tasks_counter = tasks_counter + 1
Expand Down Expand Up @@ -801,7 +801,7 @@ def export_my_anime():

cookies = Config.read_cookie()
if not cookies:
err_print(0, f"請先設定cookie後再執行此指令", status=1, no_sn=True)
err_print(0, "請先設定cookie後再執行此指令", status=1, no_sn=True)
return

page = 1
Expand Down

0 comments on commit a5edfb1

Please sign in to comment.