fix python script to turn short youtube url to normal
This commit is contained in:
parent
cda268e6f7
commit
38c2859280
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue