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

[Twitch] Add support for collections as per #20414 #20604

Closed
wants to merge 5 commits into from

Conversation

mtilbury
Copy link
Contributor

@mtilbury mtilbury commented Apr 8, 2019

Please follow the guide below

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

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Explanation of your pull request in arbitrary form goes here. Please make sure the description explains the purpose and effect of your pull request and is worded well enough to be understood. Provide as much context and examples as possible.

Trying to download a Twitch collection (example) would result in an error: the url would fall to the TwitchStream regex and it would report that 'collections' is offline as if it were a streamer. I created TwitchCollectionsIE, a new extractor to retrieve the collection items as a playlist. Information on the Collections API can be found here.

@cromefire
Copy link

Fixes #20414

@cromefire
Copy link

I think you have to write that into the description to work

@cromefire
Copy link

@dstftw Can you please merge this one?

Copy link

@cromefire cromefire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix that issue

@@ -435,6 +435,62 @@ class TwitchVideosBaseIE(TwitchPlaylistBaseIE):
_PLAYLIST_PATH = TwitchPlaylistBaseIE._PLAYLIST_PATH + '&broadcast_type='


class TwitchCollectionsIE(TwitchBaseIE):
IE_NAME = 'twitch:collections'
_VALID_URL = r'%s/collections/(?P<id>[\w\d]+)' % TwitchBaseIE._VALID_URL_BASE
Copy link

@cromefire cromefire Apr 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twitch collection IDs can have hyphens e.g. HgTD8zFrghUb-Q, so it should be:

    _VALID_URL = r'%s/collections/(?P<id>[\w\d\-]+)' % TwitchBaseIE._VALID_URL_BASE

@cromefire
Copy link

Thanks

@cromefire
Copy link

I just looked through a bunch of collections and verified that this should work now

@KhanMaytok
Copy link

Pls merge it

@dstftw dstftw closed this in 841b683 Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants