Skip to content

Commit

Permalink
Feat: 对autofeed_url进行base64编码,适配新autofeed,目前部分情况可能出现链接自动打开时程序崩溃的问题,请将…
Browse files Browse the repository at this point in the history
…链接手动粘贴到浏览器。
  • Loading branch information
bjdbjd committed Jun 7, 2024
1 parent ae64fdd commit 52d34b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
28 changes: 18 additions & 10 deletions src/gui/startgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ def auto_feed_button_movie_clicked(self):
self.debugBrowserMovie.append("auto_feed_link: " + auto_feed_link)
pyperclip.copy(auto_feed_link)
self.debugBrowserMovie.append("auto_feed链接已经复制到剪切板,请粘贴到浏览器访问")
if get_settings("open_auto_feed_link"):
webbrowser.open(auto_feed_link)
try:
if get_settings("open_auto_feed_link"):
webbrowser.open(auto_feed_link)
except Exception as e:
self.debugBrowserMovie.append(f'自动打开链接失败,请手动粘贴到浏览器访问:{e}')

def get_pt_gen_button_movie_clicked(self):
self.descriptionBrowserMovie.setText("")
Expand Down Expand Up @@ -671,7 +674,7 @@ def handle_make_torrent_movie_result(self, get_success, response):
# 以下是TV页面的代码
def start_button_tv_clicked(self):
if get_settings("second_confirm_file_name"):
self.debugBrowserMovie.append("如需一键启动,请到设置关闭二次确认文件名功能")
self.debugBrowserTV.append("如需一键启动,请到设置关闭二次确认文件名功能")
return
self.get_name_button_tv_clicked()
QApplication.processEvents() # 处理所有挂起的事件,更新页面
Expand Down Expand Up @@ -700,8 +703,11 @@ def auto_feed_button_tv_clicked(self):
self.debugBrowserTV.append("auto_feed_link: " + auto_feed_link)
pyperclip.copy(auto_feed_link)
self.debugBrowserTV.append("auto_feed链接已经复制到剪切板,请粘贴到浏览器访问")
if get_settings("open_auto_feed_link"):
webbrowser.open(auto_feed_link)
try:
if get_settings("open_auto_feed_link"):
webbrowser.open(auto_feed_link)
except Exception as e:
self.debugBrowserTV.append(f'自动打开链接失败,请手动粘贴到浏览器访问:{e}')

def get_pt_gen_button_tv_clicked(self):
self.descriptionBrowserTV.setText("")
Expand Down Expand Up @@ -1224,9 +1230,11 @@ def auto_feed_button_playlet_clicked(self):
self.debugBrowserPlaylet.append("auto_feed_link: " + auto_feed_link)
pyperclip.copy(auto_feed_link)
self.debugBrowserPlaylet.append("auto_feed链接已经复制到剪切板,请粘贴到浏览器访问")
if get_settings("open_auto_feed_link"):
# webbrowser.open(auto_feed_link)
os.system(f'start {auto_feed_link}')
try:
if get_settings("open_auto_feed_link"):
webbrowser.open(auto_feed_link)
except Exception as e:
self.debugBrowserPlaylet.append(f'自动打开链接失败,请手动粘贴到浏览器访问:{e}')

def get_description_playlet_clicked(self):
try:
Expand Down Expand Up @@ -1475,7 +1483,7 @@ def get_name_button_playlet_clicked(self):
'PT-Gen未检测到英文名称,请注意使用英文标点符号')
if ok:
print(f'您输入的数据为: {text}')
self.debugBrowserTV.append(f'您输入的数据为: {text}')
self.debugBrowserPlaylet.append(f'您输入的数据为: {text}')
english_title = text.replace('.', ' ')
invalid_characters = ''
for char in english_title:
Expand All @@ -1489,7 +1497,7 @@ def get_name_button_playlet_clicked(self):
return
else:
print('未输入任何数据')
self.debugBrowserTV.append('未输入任何数据')
self.debugBrowserPlaylet.append('未输入任何数据')
english_title = ''
year = self.yearEditPlaylet.text()
season = self.seasonBoxPlaylet.text()
Expand Down
2 changes: 1 addition & 1 deletion static/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"main_title_tv": "{en_title} S{season} {year} {video_format} {source} {video_codec} {bit_depth} {hdr_format} {frame_rate} {audio_codec} {channels} {audio_num}-{team}",
"make_dir": "True",
"media_info_suffix": "True",
"open_auto_feed_link": "",
"open_auto_feed_link": "True",
"paste_screenshot_url": "True",
"picture_bed_api_token": "6d207e02198a847aa98d0a2a901485a5",
"picture_bed_api_url": "https://freeimage.host/api/1/upload",
Expand Down

0 comments on commit 52d34b9

Please sign in to comment.