Skip to content

Commit c19c82e

Browse files
committed
default youtube-dl exec is now configurable
1 parent 2aa350b commit c19c82e

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ pip install --user .
122122
pip uninstall auto-ytdl
123123
```
124124

125+
If you don't wish to install, you can directly run:
126+
```python aytdl.py```
127+
instead of ```aytdl```
128+
125129
# Usage
126130

127131
Once installed you can run

autoytdl/AYTDL.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ def prepare_ytdl_commmand_line(dateafter):
7272
url = "\""+url+"\""
7373

7474
# here we run youtube-dl
75-
exit_code = os.system("youtube-dlc " +
75+
ytdl_exe = None
76+
if hasattr(self.config, 'youtube_dl_executable'):
77+
ytdl_exe = self.config.youtube_dl_executable
78+
if ytdl_exe is None or ytdl_exe == "":
79+
ytdl_exe = "youtube-dlc"
80+
exit_code = os.system(ytdl_exe + " " +
7681
prepare_ytdl_commmand_line(dateafter) + " " + url)
7782
if exit_code != 0: # may be a youtube-dl error taht is recoverable
7883
ask = "Y"

autoytdl/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ def __init__(self):
8686
self.embed_thumbnail = True
8787

8888
# youtube-dl args section
89+
90+
self.comments += ["youtube-dl executable, path or command"]
91+
self.youtube_dl_executable = "youtube-dlc"
92+
8993
self.comments += [""] # padding
9094
self.comments += [
9195
"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"]

autoytdl/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# follows semantic versionning
2-
__version__ = "1.2.5"
2+
__version__ = "1.3.0"

0 commit comments

Comments
 (0)