fix python script to turn short youtube url to normal

This commit is contained in:
edbrz9 2022-12-30 20:11:36 +01:00
parent cda268e6f7
commit 38c2859280
1 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,16 @@ import os
url = sys.argv[1] url = sys.argv[1]
lang = sys.argv[2] lang = sys.argv[2]
# https://youtu.be/dxt7w5NUub8
# https://www.youtube.com/watch?v=456456
bad_url = "youtu.be/"
good_url = "www.youtube.com/watch?v="
if "youtu.be" in url:
url_update = url.replace(bad_url, good_url)
url = url_update
ydl_opts = { ydl_opts = {
'writesubtitles': True, 'writesubtitles': True,
'writeautomaticsub': True, 'writeautomaticsub': True,