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] Support channel search #30570

Merged
merged 1 commit into from
Feb 3, 2022
Merged

Conversation

pukkandan
Copy link
Contributor

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

Code from yt-dlp/yt-dlp@cd68417
Closes #29071

@dirkf
Copy link
Contributor

dirkf commented Feb 2, 2022

In addition to this it seems that we could have resurrected YoutubeSearchURLIE with a class body as below:

    # override SearchInfoExtractor.suitable() without copy/paste - surely there must be a better way?
    suitable = classmethod(InfoExtractor.suitable.__func__)

    def _real_extract(self, url):
        qs = parse_qs(url)
        query = (qs.get('search_query') or qs.get('q'))[-1]
        self._SEARCH_PARAMS = qs.get('sp', (None, ))[-1]
        return super(YoutubeSearchURLIE, self)._real_extract('ytsearchall:%s' % query)

But your #27749 is more satisfactory.

@dirkf dirkf merged commit 78ce962 into ytdl-org:master Feb 3, 2022
@pukkandan
Copy link
Contributor Author

That was basically my original implementation. Except I didn't use super calls. e309ff3

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.

youtube: can't scrape from channel search
2 participants