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

exporting %(uploader)s and %(uploader_id)s as bash variables #9185

Closed
sapphonie opened this issue Apr 13, 2016 · 8 comments
Closed

exporting %(uploader)s and %(uploader_id)s as bash variables #9185

sapphonie opened this issue Apr 13, 2016 · 8 comments

Comments

@sapphonie
Copy link

@sapphonie sapphonie commented Apr 13, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [x] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.04.13. 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.04.13

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -v <your command line>
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2016.04.13
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
...
<end of log>

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):


Description of your issue, suggested solution and other information

Okay, so I have this script to download all videos from a specific youtube channel:

#!/bin/bash
echo "You entered: $1 for the URL "
sleep 1
echo "Now downloading all videos from URL "$1""
youtube-dl -iw \
--no-continue $1 \
-f bestvideo+bestaudio --merge-output-format mkv \
-o "%(uploader)s{%(uploader_id)s}/[%(upload_date)s] %(title)s" \
--add-metadata --download-archive archive.txt

Here's the problem: I want to have the archive.txt file put into the output folder of the videos.

How do I do that? Can you possibly export %(uploader)s or %(uploader_id)s as variables?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 13, 2016

This does not make any sense since you may end up with different path for different videos thus having multiple archive files.

@dstftw dstftw closed this Apr 13, 2016
@sapphonie
Copy link
Author

@sapphonie sapphonie commented Apr 14, 2016

I want to download channel "X" into folder uploader{uploader_id}/ and put the archive.txt file inside of uploader{uploader_id}/ (i.e. at uploader{uploader_id}/archive.txt )

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 16, 2016

Again: techically in general uploader/uploader_id/etc for the videos of the same playlist may differ since these are plain extracted metafields. If this happens you'll end up with multiple archive files that is not what --download-archive was designed for.

@sapphonie
Copy link
Author

@sapphonie sapphonie commented Apr 16, 2016

How would the uploader/uploader_id vars differ if all of the videos on a channel are uploaded by the same person?

@sapphonie
Copy link
Author

@sapphonie sapphonie commented Apr 16, 2016

Also, see this feature request: #9201

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 16, 2016

in general

Generic playlist may contain arbitrary videos not only from single uploader.

@sapphonie
Copy link
Author

@sapphonie sapphonie commented Apr 16, 2016

Oh. Still, there should be a way to put the archive file with the downloaded videos. I've got this script (https://github.com/TheSqrtMinus1/download-youtube-channel-hq) working, but it's a really ugly workaround and I believe that there's a better way.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 16, 2016

In any case it should be achieved not via template based download archive since it otherwise will introduce total mess when one will start using it with heterogeneous playlists/videos.

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
2 participants
You can’t perform that action at this time.