fix subtitle download of first video of channel without folder

This commit is contained in:
simon 2022-02-05 23:42:42 +07:00
parent 44af78b7e3
commit 52013aff3f
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -113,6 +113,8 @@ class YoutubeSubtitle:
) )
response = requests.get(subtitle["url"]) response = requests.get(subtitle["url"])
if response.ok: if response.ok:
# create folder here for first video of channel
os.makedirs(os.path.split(dest_path)[0], exist_ok=True)
with open(dest_path, "w", encoding="utf-8") as subfile: with open(dest_path, "w", encoding="utf-8") as subfile:
subfile.write(response.text) subfile.write(response.text)
else: else: