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

[Question] common _search_regex function always throws exception #15668

Closed
Wandang opened this issue Feb 21, 2018 · 1 comment
Closed

[Question] common _search_regex function always throws exception #15668

Wandang opened this issue Feb 21, 2018 · 1 comment
Labels

Comments

@Wandang
Copy link
Contributor

@Wandang Wandang commented Feb 21, 2018

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

Before submitting an issue make sure you have:

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

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

Description of your issue, suggested solution and other information

I am having trouble with common.py's _search_regex function.
Based on the description I can give it a pattern/regex, a string to search through and a code word for logging that is free to chose.

Furthermore it states that it takes the first matching group to work with. I just can't get this to work.
I've gone so far to blatantly search for a fixed url in the webpage: https://regex101.com/r/33L08o/1

The webpage is http://www.vol.at/blue-man-group/5593454

As you can see in the regex101.com link the first group that is detected is the url. But I still get an RegexNotFoundError/Exception.

My code:

        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        title =  self._og_search_title(webpage)
        print("regex test")
        video_url = self._search_regex(
            r'(?s)file:\s*"(https://vs-pd-russmedia\.sf\.apa\.at/vs_vn/20171215_20_169570_bluemangroupe_720\.mp4\?guid=293f6d17-692a-44e3-9fd5-7b178f3a1029)"',
            webpage, 'url')
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 21, 2018

There is no code matching this regex at http://www.vol.at/blue-man-group/5593454 thus you are getting RegexNotFoundError.

@dstftw dstftw closed this Feb 21, 2018
@dstftw dstftw added the question label Feb 21, 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.