Skip to content

Commit

Permalink
Fix missing file error in TitleDescriptionUpdater.py
Browse files Browse the repository at this point in the history
Now it only tries to open the translated json file if the user selects to update the title and description.

Update Version 0.19.0
  • Loading branch information
ThioJoe committed Jan 21, 2024
1 parent 87f5170 commit 3b7f740
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions Tools/TitleDescriptionUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
pass
else:
print("Warning: Not currently in the 'Tools' folder. The script may not work properly.")
# Set the path to include the project root folder, so Scripts imports are valid
sys.path.insert(1, os.getcwd())
sys.path.insert(1, os.getcwd())
# ---------------------------------------------------------------------------------------
from Scripts.shared_imports import *
import Scripts.auth as auth
Expand All @@ -38,10 +38,12 @@
import json

import langcodes

# Import translated json file
with open(translatedJsonFile, "r", encoding='utf-8') as f:
translatedJson = json.load(f)
if updateTitleAndDescription:
with open(translatedJsonFile, "r", encoding='utf-8') as f:
translatedJson = json.load(f)
else:
translatedJson = None

YOUTUBE_API = auth.youtube_authentication()

Expand Down Expand Up @@ -245,4 +247,4 @@ def get_video_title(videoID):
print("\nUploading caption for language: " + languageDisplayName + " (" + langCode + ")")
upload_caption(videoID, langCode, "", filePath) # Use empty string as the name, so it will apply as the default caption for that language

print("\nDone!")
print("\nDone! It might take a couple minutes for the subtitles to show up on YouTube.")
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# License: GPLv3
# NOTE: By contributing to this project, you agree to the terms of the GPLv3 license, and agree to grant the project owner the right to also provide or sell this software, including your contribution, to anyone under any other license, with no compensation to you.

version = '0.18.1'
version = '0.19.0'
print(f"------- 'Auto Synced Translated Dubs' script by ThioJoe - Release version {version} -------")

# Import other files
Expand Down

0 comments on commit 3b7f740

Please sign in to comment.