Skip to content

Commit

Permalink
default youtube-dl exec is now configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelb committed Jan 15, 2021
1 parent 2aa350b commit c19c82e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ pip install --user .
pip uninstall auto-ytdl
```

If you don't wish to install, you can directly run:
```python aytdl.py```
instead of ```aytdl```

# Usage

Once installed you can run
Expand Down
7 changes: 6 additions & 1 deletion autoytdl/AYTDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ def prepare_ytdl_commmand_line(dateafter):
url = "\""+url+"\""

# here we run youtube-dl
exit_code = os.system("youtube-dlc " +
ytdl_exe = None
if hasattr(self.config, 'youtube_dl_executable'):
ytdl_exe = self.config.youtube_dl_executable
if ytdl_exe is None or ytdl_exe == "":
ytdl_exe = "youtube-dlc"
exit_code = os.system(ytdl_exe + " " +
prepare_ytdl_commmand_line(dateafter) + " " + url)
if exit_code != 0: # may be a youtube-dl error taht is recoverable
ask = "Y"
Expand Down
4 changes: 4 additions & 0 deletions autoytdl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def __init__(self):
self.embed_thumbnail = True

# youtube-dl args section

self.comments += ["youtube-dl executable, path or command"]
self.youtube_dl_executable = "youtube-dlc"

self.comments += [""] # padding
self.comments += [
"youtube-dl arguments: double-dash \"--\" arguments may be appended at the END of the config file:\n#write: \"option name without --\" = true/false/value\n#-> true to activate a flag\n#-> false to make it not appear in the command\n#-> value (or \"value\" for string values) to set the option argument"]
Expand Down
2 changes: 1 addition & 1 deletion autoytdl/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# follows semantic versionning
__version__ = "1.2.5"
__version__ = "1.3.0"

0 comments on commit c19c82e

Please sign in to comment.