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

Unable to download shelf? #7415

Closed
tantalate opened this issue Nov 10, 2015 · 1 comment
Closed

Unable to download shelf? #7415

tantalate opened this issue Nov 10, 2015 · 1 comment

Comments

@tantalate
Copy link

@tantalate tantalate commented Nov 10, 2015

Hi, i would like to use this to download a shelf (playlists) like this page.

However, when I use youtube-dl -o './%(playlist_title)s/%(title)s-%(id)s.%(ext)s' "https://www.youtube.com/user/afigfigueira/playlists?sort=dd&view=50&shelf_id=6" to download it, it will download all the files the user have uploaded, and the %(playlist_title)s only gave a title like this Uploads from Arnaldo Pedro Figueira Figueira, not the real titles of the playlists.

Is shelf supported by now?

@tantalate
Copy link
Author

@tantalate tantalate commented Nov 10, 2015

it seems that shelf is not supported for now, so i wrote this little script to download all playlists in a shelf. Paste it here in case it may help someone.

import requests
import os
#from lxml import etree
from bs4 import BeautifulSoup


r = requests.get("http://www.youtube.com/user/afigfigueira/playlists?sort=dd&view=50&shelf_id=6")
#r = requests.get("https://www.youtube.com/watch?v=LTDmMI4VSCM&list=PLO9y7hOkmmSF2-_mB46a23K2UOkH5ic8T")


html = r.content

# tree = etree.HTML(html)
soup = BeautifulSoup(html, 'lxml')

lists = soup.find_all('a', class_="yt-uix-tile-link")

for lst in lists:
        print(lst.get('href'))
        os.system("youtube-dl -o '%(playlist)s/%(title)s.%(ext)s' " + "https://www.youtube.com" + lst.get('href'))
@tantalate tantalate closed this Nov 10, 2015
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
1 participant
You can’t perform that action at this time.