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

youtube: -j --flat-playlist with channel different in CLI than return from API call #18183

Closed
patrickscottbest opened this issue Nov 14, 2018 · 1 comment
Labels

Comments

@patrickscottbest
Copy link

@patrickscottbest patrickscottbest commented Nov 14, 2018

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

Before submitting an issue make sure you have:

  • [x ] At least skimmed through the README, most notably the FAQ and BUGS sections
  • [x ] Searched the bugtracker for similar issues including closed ones
  • [x ] Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • [x ] 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

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--flat-playlist', '-j', '-v', 'https://www.youtube.com/channel/UC6RNSPFcqY4BblL2Jg9SUtw']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.11.07
[debug] Python version 3.6.5 (CPython) - Linux-3.10.0-862.14.4.el7.x86_64-x86_64-with-centos-7.5.1804-Core
[debug] exe versions: ffmpeg 2.8.15, ffprobe 2.8.15
[debug] Proxy map: {}
{"_type": "url", "url": "IaNEfhPmhPM", "ie_key": "Youtube", "id": "IaNEfhPmhPM", "title": "Rona in Aurora - the death of a big box"}
{"_type": "url", "url": "JN-2vTf8-WM", "ie_key": "Youtube", "id": "JN-2vTf8-WM", "title": "RealWorldNumbers - How to Test a Raspberry Pi Powered by Alkaline AA Batteries - After Poweroff"}
{"_type": "url", "url": "NmQmM36ja3o", "ie_key": "Youtube", "id": "NmQmM36ja3o", "title": "RealWorldNumbers - How to Test a Raspberry Pi Powered by Alkaline AA Batteries - During the Test"}
{"_type": "url", "url": "MsrgW1Rdlso", "ie_key": "Youtube", "id": "MsrgW1Rdlso", "title": "Raspberry Pi powered by AA batteries direct"}
(bestpa) [bestpa@oraclevm vidbackup]$ 
---


Playlist: https://www.youtube.com/channel/UC6RNSPFcqY4BblL2Jg9SUtw


---

### Description of your *issue*, suggested solution and other information

I've got a problem whereby when I call  youtube-dl  from the CLI with "-j --flat-playlist" I get a list of videos, but when i make the same call using  the same arguments from an imported instance of the python library, it only presents a single object (instead of iterating through the list of videos).

I've opened up a discussion on stackoverflow, but no real explanation for the behaviour.
https://stackoverflow.com/questions/53288922/youtube-dl-dump-json-returning-different-extractor-output-for-playlist-when-ca

Here's the python code: 

    import youtube_dl
    ydl_opts = {
        'extract_flat': True, ## --flat-playlist according to options.py
         'dumpjson': True, ## lower -j
         #'dump_single_json': True, ## UPPER -J
    }
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        object = ydl.extract_info(providedURL, download=False)
        print (object)
        print len(object)
  print (youtube_dl.version.unicode_literals)

Her'es the output

[youtube:channel] UC6RNSPFcqY4BblL2Jg9SUtw: Downloading channel page
{'_type': 'url', 'url': 'https://www.youtube.com/playlist?list=UU6RNSPFcqY4BblL2Jg9SUtw', 'ie_key': 'YoutubePlaylist', 'extractor': 'youtube:channel', 'webpage_url': 'https://www.youtube.com/channel/UC6RNSPFcqY4BblL2Jg9SUtw', 'webpage_url_basename': 'UC6RNSPFcqY4BblL2Jg9SUtw', 'extractor_key': 'YoutubeChannel'}

7


Long shot, but wonder if this could be resurgence or related to a closed issue from 2015.  https://github.com/rg3/youtube-dl/issues/4971

I'd like to know more about the procedural different between the cli and using the python .extract_info method.  Is this because of the nature of the interactive shell when using the CLI method?

sorry my markup is terrible on this report.  I hope that you guys can read past it.  Late. Tired. Thanks.

@patrickscottbest patrickscottbest changed the title youtube: -j --flat-playlist with channel different than return from API call youtube: -j --flat-playlist with channel different in CLI than return from API call Nov 14, 2018
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 14, 2018

  1. Have you actually read the doc? You're getting exactly what requested.
    extract_flat:      Do not resolve URLs, return the immediate result.
                       Pass in 'in_playlist' to only show this behavior for
                       playlist items.

Pass in 'in_playlist' to only show this behavior for playlist items.

Passing True will forbid any recursive resolving including playlists (will forbid resolving channel to playlist url delegate transition in your case). in_playlist will forbid resolving but only at playlist level (allowing aforementioned transition), that produces info dict with the same list of videos under entries.
2. --dump-* options don't return anything, they are verbose options for printing to stdout. dump* API options have no effect on extract_info.

@dstftw dstftw closed this Nov 14, 2018
@dstftw dstftw added the invalid label Nov 14, 2018
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.