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

[xhamster] - "No video format found" with pending fix #25804 and possible workaround #26157

Closed
TheRealDude2 opened this issue Jul 29, 2020 · 2 comments

Comments

@TheRealDude2
Copy link
Contributor

@TheRealDude2 TheRealDude2 commented Jul 29, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.07.28
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-c', '--batch-file=dl.txt', '-v']
[debug] Batch file urls: ['https://de.xhamster.com/videos/sarah-fc-xh6SnVE']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Git HEAD: a4ed50bb8
[debug] Python version 3.7.3 (CPython) - Linux-4.19.118-v7+-armv7l-with-debian-10.4
[debug] exe versions: ffmpeg 4.1.6-1, ffprobe 4.1.6-1
[debug] Proxy map: {}
[XHamster] xh6SnVE: Downloading webpage
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/home/apadmin/git/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/home/apadmin/git/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/home/apadmin/git/youtube-dl/youtube_dl/extractor/xhamster.py", line 242, in _real_extract
    self._sort_formats(formats)
  File "/home/apadmin/git/youtube-dl/youtube_dl/extractor/common.py", line 1350, in _sort_formats
    raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

I use a testing extractor with the pending fix #25804 [Xhamster] Updated regex to accommodate new video_id with letters .

I noticed a new problem today "No video formats found".

I adjusted line 139 in my test extractor and now it seems to work again for the moment.
r'window.initials\s*=\s*({.+?})\s*;\s*\n', webpage, 'initials',
to
r'window.initials\s*=\s*({.+?})\s*;\s*', webpage, 'initials',

The problem seems to be that on the page the initials no longer end with a new line.

Maybe the information will help someone to provide a fix. I suspect that there will be some further adjustments to be made here, as too much information may end up in the initials variable.

@msilletti
Copy link

@msilletti msilletti commented Aug 5, 2020

I can confirm this fixes the issue.

--- a/youtube_dl/extractor/xhamster.py	2020-08-05 05:56:48.570145132 -0400
+++ b/youtube_dl/extractor/xhamster.py	2020-08-05 05:59:08.656243722 -0400
@@ -132,7 +132,7 @@ class XHamsterIE(InfoExtractor):
 
         initials = self._parse_json(
             self._search_regex(
-                r'window\.initials\s*=\s*({.+?})\s*;\s*\n', webpage, 'initials',
+                r'window.initials\s*=\s*({.+?})\s*;\s*', webpage, 'initials',
                 default='{}'),
             video_id, fatal=False)
         if initials:

@msilletti
Copy link

@msilletti msilletti commented Aug 5, 2020

@TheRealDude2 - Send a pull request so the maintainer can fix it easy.

dstftw pushed a commit that referenced this issue Aug 12, 2020
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.

2 participants
You can’t perform that action at this time.