Skip to content

Commit

Permalink
Merge pull request #69 from offish/v1.6.5
Browse files Browse the repository at this point in the history
v1.6.5
  • Loading branch information
offish authored Aug 22, 2021
2 parents b2b41cc + 6a822b2 commit 22bc9a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def str_to_bool(value):
parser.add_argument("--language", type=str, help="")
parser.add_argument("--limit", type=int, help="")
parser.add_argument("--profile_path", type=str, help="")
parser.add_argument("--executable_path", type=str, help="")
parser.add_argument("--sleep", type=int, help="")
parser.add_argument("--headless", type=str_to_bool, help="")
parser.add_argument("--debug", type=str_to_bool, help="")
Expand Down
2 changes: 1 addition & 1 deletion twitchtube/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__title__ = "twitchtube"
__author__ = "offish"
__license__ = "MIT"
__version__ = "1.6.4"
__version__ = "1.6.5"
5 changes: 3 additions & 2 deletions twitchtube/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@


# selenium
ROOT_PROFILE_PATH = r"" # Path to the Firefox profile where you are logged into YouTube
ROOT_PROFILE_PATH = r"C:/Users/USERNAME/AppData/Roaming/Mozilla/Firefox/Profiles/r4Nd0m.selenium" # Path to the Firefox profile where you are logged into YouTube
EXECUTABLE_PATH = r"geckodriver"
SLEEP = 3 # How many seconds Firefox should sleep for when uploading
HEADLESS = False # If True Firefox will be hidden (True/False)
HEADLESS = True # If True Firefox will be hidden (True/False)


# video options
Expand Down
8 changes: 6 additions & 2 deletions twitchtube/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def make_video(
limit: int = LIMIT,
# selenium
profile_path: str = ROOT_PROFILE_PATH,
executable_path: str = EXECUTABLE_PATH,
sleep: int = SLEEP,
headless: bool = HEADLESS,
debug: bool = DEBUG,
Expand Down Expand Up @@ -190,12 +191,12 @@ def make_video(
log.info("No Firefox profile path given, skipping upload")

else:
upload = Upload(profile_path, sleep, headless, debug)
upload = Upload(profile_path, executable_path, sleep, headless, debug)

log.info("Trying to upload video to YouTube")

try:
was_uploaded, video_id = upload.upload(config)
was_uploaded, video_id = upload.upload(**config)

if was_uploaded:
log.info(f"{video_id} was successfully uploaded to YouTube")
Expand All @@ -205,6 +206,9 @@ def make_video(
f"There was an error {e} when trying to upload to YouTube"
)

finally:
upload.close()

if delete_clips:
log.info("Getting files to delete...")
files = glob(f"{path}/*.mp4")
Expand Down

0 comments on commit 22bc9a1

Please sign in to comment.