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

pornHD extractor not working properly #4893

Closed
operabeats opened this issue Feb 7, 2015 · 3 comments
Closed

pornHD extractor not working properly #4893

operabeats opened this issue Feb 7, 2015 · 3 comments

Comments

@operabeats
Copy link

@operabeats operabeats commented Feb 7, 2015

Hi

I was trying download video from pornHD (http://www.pornhd.com/videos/2602/horny-blondes-really-into-facesitting-hd-porn-movie) and I get the following error:

File "/home/vaio/temp/youtube_dl/extractor/pornhd.py", line 56, in real_extract
r"(?s)'sources'\s
:\s_({.+?})\s*});", webpage, 'sources')))
File "/home/vaio/temp/youtube_dl/extractor/common.py", line 524, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract sources; 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.

I tinkered with pornhd.py extractor file and found there was an error in regex for "source"

sources = json.loads(js_to_json(self._search_regex(
            r"(?s)'sources'\s*:\s*(\{.+?\})\s*\}\);", webpage, 'sources')))

and changed it to

        sources = json.loads(js_to_json(self._search_regex(
            r"(?s)'sources'\s*:\s*(\{.+?\})\s*\}", webpage, 'sources')))

then there was error with next block, so changed:

formats = []
        for container, s in sources.items():
            for qname, video_url in s.items():
                formats.append({
                    'url': video_url,
                    'container': container,
                    'format_id': '%s-%s' % (container, qname),
                    'quality': quality(qname),
                })
        self._sort_formats(formats)

to

        formats = []
        for qname, video_url in sources.items():
                formats.append({
                    'url': video_url,
                    'quality': quality(qname),
                })
        self._sort_formats(formats)

Now I am getting the following error:

File "/usr/lib/python2.7/cookielib.py", line 604, in eff_request_host
erhn = req_host = request_host(request)
File "/usr/lib/python2.7/cookielib.py", line 592, in request_host
host = request.get_header("Host", "")
AttributeError: '_PseudoRequest' object has no attribute 'get_header'

Please help me getting this resolved.
(I am new to python / js / json and first time posting on github, please pardon me if there are any mistakes. Let me know if any further info is required)

(if this helps someone, i used http://pythex.org/ to understand the regex!)

@rrooij
Copy link
Contributor

@rrooij rrooij commented Feb 10, 2015

Can confirm this. I tried to figure it out too, but haven't been able to get far.

Edit: Oops, I've updated to the latest version, and it works now.

python -m youtube_dl -v --test 'http://www.pornhd.com/videos/2602/horny-blondes-really-into-facesitting-hd-porn-movie'                                     
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--test', 'http://www.pornhd.com/videos/2602/horny-blondes-really-into-facesitting-hd-porn-movie']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.02.10.5
[debug] Git HEAD: 054fe3c
[debug] Python version 3.4.2 - Linux-3.18.6-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 2.5.3, ffprobe 2.5.3, rtmpdump 2.4
[debug] Proxy map: {}
[PornHd] horny-blondes-really-into-facesitting-hd-porn-movie: Downloading webpage
[debug] Invoking downloader on 'http://37.48.82.245/402/dLBvbToZu6/video_hq.mp4?sh=NVyj30OuibVNaKqYPjQTbA&ttl=1423600741'
[download] Destination: Horny blonde sits on her friend's face-2602.mp4
[download] 100% of 10.00KiB in 00:00

Check the FAQ for more information on how to update youtube-dl.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 10, 2015

Indeed, this has already been fixed in youtube-dl 2015.02.10.3 and newer. Refer to our FAQ if you have trouble updating youtube-dl.

@phihag phihag closed this Feb 10, 2015
@operabeats
Copy link
Author

@operabeats operabeats commented Feb 11, 2015

it works now
As always you are incredibly fast! Thank you..!

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
3 participants
You can’t perform that action at this time.