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

Home variable not expanded in config file. #9429

Closed
kdeldycke opened this issue May 7, 2016 · 2 comments
Closed

Home variable not expanded in config file. #9429

kdeldycke opened this issue May 7, 2016 · 2 comments

Comments

@kdeldycke
Copy link
Contributor

@kdeldycke kdeldycke commented May 7, 2016

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.05.01. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.05.01

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

I have the following config file:

$ cat ~/.config/youtube-dl.conf 
--batch-file ~/watch-later.txt

When I call the CLI, it find the config file but fail to parse the --batch-file parameter because of the usage of the ~ shortcut:

$ youtube-dl -v
[debug] System config: []
[debug] User config: [u'--batch-file', u'~/watch-later.txt']
[debug] Command-line args: [u'-v']
ERROR: batch file could not be read

The the thing is, ~ is properly extended when the CLI is called from a shell:

$ youtube-dl -v --batch-file ~/watch-later.txt
[debug] System config: []
[debug] User config: [u'--batch-file', u'~/watch-later.txt']
[debug] Command-line args: [u'-v', u'--batch-file', u'/Users/kdeldycke/watch-later.txt']
[debug] Batch file urls: [u'http://youtu.be/Y-rmzh0PI3c']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.05.01
[debug] Python version 2.7.11 - Darwin-15.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] Y-rmzh0PI3c: Downloading webpage
[youtube] Y-rmzh0PI3c: Downloading video info webpage
[youtube] Y-rmzh0PI3c: Extracting video information
[youtube] Y-rmzh0PI3c: Downloading MPD manifest
[debug] Invoking downloader on u'https://r5---sn-4gxx-25g6.googlevideo.com/videoplayback?dur=730.615&key=yt6&lmt=1439788345379730&fexp=9405991%2C9413138%2C9416126%2C9416891%2C9419277%2C9421352%2C9422596%2C9423347%2C9427789%2C9428398%2C9428790%2C9431012%2C9431270%2C9432365%2C9433096%2C9433946%2C9434606%2C9435331%2C9435667%2C9436129&usequic=no&ipbits=0&initcwndbps=765000&mime=video%2Fmp4&requiressl=yes&signature=C00C6529010C74C3564A05B1C52041959ADCBA94.E29705494DC729653F7D161F085D7415D9A16BA8&source=youtube&upn=AYLUoR11-rM&ms=au&itag=22&pl=15&mt=1462642550&mn=sn-4gxx-25g6&mm=31&mv=m&id=o-ADVWV25T1VWCApkACwdrsxRXqBGpnsvxqW-DHAKYA8LD&sver=3&ratebypass=yes&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cusequic%2Cexpire&ip=88.190.24.238&expire=1462664348'
[download] Resuming download at byte 2096128
[download] Destination: /Users/kevin/Cosmos Laundromat - First Cycle. Official Blender Foundation release.-Y-rmzh0PI3c.mp4
[download]  23.2% of 164.11MiB at 18.81MiB/s ETA 00:06
(...)

I think this bug can be fixed by always expanding the ~ home variable when normalizing the batch file parameter.

@kdeldycke
Copy link
Contributor Author

@kdeldycke kdeldycke commented May 7, 2016

Just found out there's already a compat_expanduser() method defined in the project to handle this case at: https://github.com/rg3/youtube-dl/blob/536a55dabd7bcc2f34195beb84211028c934ed7a/youtube_dl/compat.py#L375

@kdeldycke
Copy link
Contributor Author

@kdeldycke kdeldycke commented May 7, 2016

Just pushed a PR at: #9430

@dstftw dstftw closed this in #9430 May 7, 2016
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.

1 participant
You can’t perform that action at this time.