Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create youtube-dl.conf in OS X? #8649

Closed
RedSoxFan04 opened this issue Feb 23, 2016 · 19 comments
Closed

How to create youtube-dl.conf in OS X? #8649

RedSoxFan04 opened this issue Feb 23, 2016 · 19 comments

Comments

@RedSoxFan04
Copy link

@RedSoxFan04 RedSoxFan04 commented Feb 23, 2016

I just installed youtube-dl on my Mac, and it’s a great program. I haven’t run into a single Youtube video that it couldn’t download. I also appreciate that it downloads the videos as MP4 files. However, it downloads the videos to my user folder instead of my movies folder. It also adds a series of numbers and letters the the video names. How do I fix this?

More importantly, I’ve read that the configuration file can be used to solve issues like this. However, I’m running into one big issue: there’s no youtube.conf file on my Mac. It seems like I have to make one myself. Do I just add the options I want, or is there more that needs to go into the configuration file?

@RedSoxFan04 RedSoxFan04 changed the title How to create youtube-dl.conf in OS X How to create youtube-dl.conf in OS X? Feb 23, 2016
@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2016

Depending on your installation method, a configuration file may or may not be present. You can simply create a file ~/.config/youtube-dl.conf with a text editor of your choice. In that file, you can pass in any options. It looks like you want something like

-o "/home/RedSoxFan04/Movies/%(title)s.%(ext)s"
@phihag phihag closed this Feb 24, 2016
@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 24, 2016

Thanks! I just have one question. I saw the filepath you listed, but that’s an approxiamation. What’s the full filepath? Is it /HardDriveName/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/youtube-dl/files? http://rsync.macports.org/release/tarballs/ports/net/youtube-dl/files? When I searched for the youtube-dl folder, I found it in a MacPorts folder, which doesn’t seem right. I saw that you said to put it in ~/.config/youtube-dl.conf, but I can’t find the config folder.

On Feb 23, 2016, at 8:33 PM, Philipp Hagemeister notifications@github.com wrote:

Depending on your installation method, a configuration file may or may not be present. You can simply create a file ~/.config/youtube-dl.conf with a text editor of your choice. In that file, you can pass in any options. It looks like you want something like

-o "/home/RedSoxFan04/Movies/%(title)s.%(ext)s"

Reply to this email directly or view it on GitHub #8649 (comment).

@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2016

~ stands for /home/RedSoxFan04 (of course, if your Mac username is something else, substitute that). The configuration file is part of your home directory, in a completely different directory tree than youtube-dl itself (on Unix systems like Mac OS X, programs and data are separate, and not in the same directory).

@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 24, 2016

Oh, okay. There is one other issue. I created a configuration file with TextEdit, but it won’t let me use the .conf extension. The only way I was able to get TextEdit to save the file was by naming it youtube-dl.conf.rtf. Is that going to be a problem? Or will I need to use a different text editor?

On Feb 24, 2016, at 5:25 PM, Philipp Hagemeister notifications@github.com wrote:

~ stands for /home/RedSoxFan04 (of course, if your Mac username is something else, substitute that). The configuration file is part of your home directory, in a completely different directory tree than youtube-dl itself (on Unix systems like Mac OS X, programs and data are separate, and not in the same directory).


Reply to this email directly or view it on GitHub #8649 (comment).

@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2016

RTF is not a plain-text format. You will need to write plain text. Please refer to Apple's help page on the subject.

@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 24, 2016

Oh, okay. Thanks.

I noticed that in the option your provided, you had an “s” after “(title)” and also after “ext”. Is the “s” a delineator?

On Feb 23, 2016, at 8:33 PM, Philipp Hagemeister notifications@github.com wrote:

Depending on your installation method, a configuration file may or may not be present. You can simply create a file ~/.config/youtube-dl.conf with a text editor of your choice. In that file, you can pass in any options. It looks like you want something like

-o "/home/RedSoxFan04/Movies/%(title)s.%(ext)s"

Reply to this email directly or view it on GitHub #8649 (comment).

@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 24, 2016

I used the option you gave me, and now when I run youtube-dl, it creates a new subdirectory in my user folder. How do I fix this?

On Feb 23, 2016, at 8:33 PM, Philipp Hagemeister notifications@github.com wrote:

Depending on your installation method, a configuration file may or may not be present. You can simply create a file ~/.config/youtube-dl.conf with a text editor of your choice. In that file, you can pass in any options. It looks like you want something like

-o "/home/RedSoxFan04/Movies/%(title)s.%(ext)s"

Reply to this email directly or view it on GitHub #8649 (comment).

@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 26, 2016

When I used the -o "/home/RedSoxFan04/Movies/%(title)s.%(ext)s”, substituting RedSoxFan for my Mac username and also adding an extra folder to the path, it didn’t work. I got this response from Terminal: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module> File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 411, in main File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 57, in _real_main File "/usr/local/bin/youtube-dl/youtube_dl/options.py", line 797, in parseOpts File "/usr/local/bin/youtube-dl/youtube_dl/options.py", line 62, in _readUserConf File "/usr/local/bin/youtube-dl/youtube_dl/options.py", line 31, in _readOptions File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 279, in split return list(lex) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 269, in next token = self.get_token() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 96, in get_token raw = self.read_token() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 172, in read_token raise ValueError, "No closing quotation" ValueError: No closing quotation

@phihag
Copy link
Contributor

@phihag phihag commented Feb 26, 2016

The s is a type specifier. For more information, refer to the Python documentation.

I thought you would want to create a subdirectory /home/RedSoxFan04/Movies. If you want a different directory, please just replace /home/RedSoxFan04/Movies/ with the directory you want.

Can you post the output you get when you run cat ~/.config/youtube-dl.conf in your terminal? The error very much looks like you forgot or added a quote character.

@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 26, 2016

  1. I wanted to put downloaded videos into an existing subdirectory.
  2. Here’ the output: ERROR: u'cat' is not a valid URL. Set --default-search "ytsearch" (or run youtube-dl "ytsearch:cat" ) to search YouTube

    On Feb 25, 2016, at 8:28 PM, Philipp Hagemeister notifications@github.com wrote:

    The s is a type specifier. For more information, refer to the Python documentation https://docs.python.org/dev/library/stdtypes.html#string-formatting.

    I thought you would want to create a subdirectory /home/RedSoxFan04/Movies. If you want a different directory, please just replace /home/RedSoxFan04/Movies/ with the directory you want.

    Can you post the output you get when you run cat ~/.config/youtube-dl.conf in your terminal? The error very much looks like you forgot or added a quote character.


    Reply to this email directly or view it on GitHub #8649 (comment).

@phihag
Copy link
Contributor

@phihag phihag commented Feb 26, 2016

  1. Alright, then replace /home/RedSoxFan04/Movies with the existing subdirectory. For instance, if the existing subdirectory is /foo/bar, the config file should have the content -o "/foo/bar/%(title)s.%(ext)s".
  2. That is the output of youtube-dl cat ~/.config/youtube-dl.conf. I need the output of cat ~/.config/youtube-dl.conf.
@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 26, 2016

It still gives me this: ERROR: u'cat' is not a valid URL. Set --default-search "ytsearch" (or run youtube-dl "ytsearch:cat" ) to search YouTube

On Feb 25, 2016, at 8:44 PM, Philipp Hagemeister notifications@github.com wrote:

cat ~/.config/youtube-dl.conf

@phihag
Copy link
Contributor

@phihag phihag commented Feb 26, 2016

@RedSoxFan04 Can you post a screenshot? Do you see the same behavior in a new terminal (To open a new terminal, type ⌘+space to open Spotlight, and then type Terminal to search for the terminal app, and then press Enter).

@RedSoxFan04
Copy link
Author

@RedSoxFan04 RedSoxFan04 commented Feb 26, 2016

Here’s the screenshot:

On Feb 25, 2016, at 8:44 PM, Philipp Hagemeister notifications@github.com wrote:

Alright, then replace /home/RedSoxFan04/Movies with the existing subdirectory. For instance, if the existing subdirectory is /foo/bar, the config file should have the content -o "/foo/bar/%(title)s.%(ext)s".

That is the output of youtube-dl cat ~/.config/youtube-dl.conf. I need the output of cat ~/.config/youtube-dl.conf.
screen shot 2016-02-25 at 9 56 54 pm


Reply to this email directly or view it on GitHub #8649 (comment).

@phihag
Copy link
Contributor

@phihag phihag commented Feb 26, 2016

Sorry, I can't see any screenshot in your message. You may need to use GitHub's web interface instead of sending emails.

@leongeyer
Copy link

@leongeyer leongeyer commented Jul 18, 2018

Hope I am right in posting this, and not off topic. Seems to me like the question I had and seen answered in
https://apple.stackexchange.com/questions/237388/setup-youtube-dl-destination-to-downloads

mkdir -p ~/.config/youtube-dl/
echo "-o ~/Downloads/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config

This way you get the videos into Downloads.

@leongeyer
Copy link

@leongeyer leongeyer commented Dec 31, 2019

@bronze
Copy link

@bronze bronze commented Jan 1, 2020

@leongeyer yea I took a look and saw I had created a directory there before using the command line. stupid. I deleted the comment soon after realizing it. Working fine now!
thx for taking the time!

@leongeyer
Copy link

@leongeyer leongeyer commented Jan 1, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.