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

Trouble Downloading MP4 URLs with HTTPS Protocol on PornHub Website: Unauthorized Error #9841

Closed
9 tasks done
PankajSavaliya opened this issue May 2, 2024 · 13 comments
Closed
9 tasks done
Labels
incomplete Further information is needed NSFW question Question

Comments

@PankajSavaliya
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Please make sure the question is worded well enough to be understood

Hi,

I'm having an issue with the pornhub website. Everything works perfectly and it extracts all the information, but when trying to download an mp4 URL with the 'https' protocol, I'm getting an 'Unauthorized' error.

can you please help me how to resolve it

Screenshot_2024-05-02_at_5 24 59_PM

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

No response

@PankajSavaliya PankajSavaliya added the question Question label May 2, 2024
@bashonly
Copy link
Member

bashonly commented May 2, 2024

You are just pasting the link into your browser? Does it download with yt-dlp?

Look at all the fields in the format dict; some http_headers or cookies are probably necessary. The links also expire; the one in your address bar expired 3 hours before you created this issue.

Show a log or give a minimal reproducible example.

@bashonly bashonly added incomplete Further information is needed NSFW labels May 2, 2024
@PankajSavaliya
Copy link
Author

PankajSavaliya commented May 3, 2024

Yes, there is an expiration, but let's assume I use yt-dl to get info, and then suddenly use the URL, even though it's not working, even though the expiration time is still valid. @bashonly

Even I have tried with cookiefile but have not succeeded.

@pukkandan
Copy link
Member

https://github.com/yt-dlp/yt-dlp/wiki/FAQ#i-extracted-a-video-url-but-it-does-not-play-on-another-machine--in-my-web-browser

You still didn't answer whether yt-dlp is able to download that format or not.

@PankajSavaliya
Copy link
Author

PankajSavaliya commented May 3, 2024

No, yt-dlp cannot download videos in mp4 format using the HTTP protocol. @bashonly

However, it does support downloading videos in M3U8 format. You can verify this by testing it with any public URL from the website, and also consider checking with cookies

@pukkandan
Copy link
Member

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

No response

@PankajSavaliya
Copy link
Author

PankajSavaliya commented May 3, 2024

I'm using this kind of method in python. @pukkandan

import yt_dlp

# Set your desired options
ydl_opts = {
    'format': 'best',
    'cookiefile': '/Volumes/Pankaj/YT-DL/cache/cookies/ad6fd4df-731e-4ccf-9e7a-db0ef614d744.txt'
    'extract_flat': True,  # Extract only basic metadata, no need to download
    # Add any other options you might need
}

# Replace 'link' with the YouTube link you want to extract info from
link = 'https://www.pornhub.com/view_video.php?viewkey=ph639cc2cc573b8'

# Perform the extraction
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    info = ydl.extract_info(link, download=False)
    print(info)

Print output

{'id': 'ph639cc2cc573b8', 'uploader': 'OfficialNubiles', 'uploader_id': '/users/officialnubiles', 'upload_date': '20221216', 'title': 'Naughty Elves Molly Little and Lily Larimar say, "We lost our magic.. But we have cum now!" - S3:E3', 'thumbnail': 'https://ei.phncdn.com/videos/202212/16/421533261/original/(m=qQNRH6XbeaAaGwObaaaa)(mh=UZ9s-2htnymwshtf)0.jpg', 'duration': 1441, 'like_count': 5142, 'dislike_count': 572, 'comment_count': 45, 'formats': [{'url': 'https://ev.phncdn.com/videos/202212/16/421533261/240P_1000K_421533261.mp4?validfrom=1714729750&validto=1714736950&rate=500k&burst=2000k&ip=143.44.168.68&ipa=143.44.168.68&hash=bSAU4Kt7cEddBISu1Nutp3mcH8g%3D', 'format_id': '240p', 'height': 240, 'ext': 'mp4', 'protocol': 'https', 'resolution': '240p', 'dynamic_range': 'SDR', 'aspect_ratio': None, 'filesize_approx': None, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'tbr': None, 'format': '240p - 240p'}, {'format_id': 'hls-393-0', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/240P_1000K_421533261.mp4/index-v1-a1.m3u8?nAMso-dQx0niRXiN9fS02Gx2kEIdA0VeKejlpSHZG0pVmu8eNoUivpHDilAJNZxthkL9MP92s0aGHAcIeeKPR6Mw24zVSSdnTpUzysm5nQp-srkkBam_NoiuZBedwjJ3_frhJzmioOXs3rFr2yZNbnFdSpBarHofIMriBt83BDXnIUnlt0Twl-4OfXYiGCvzpFo95Q_ZeA', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/240P_1000K_421533261.mp4/master.m3u8?nAMso-dQx0niRXiN9fS02Gx2kEIdA0VeKejlpSHZG0pVmu8eNoUivpHDilAJNZxthkL9MP92s0aGHAcIeeKPR6Mw24zVSSdnTpUzysm5nQp-srkkBam_NoiuZBedwjJ3_frhJzmioOXs3rFr2yZNbnFdSpBarHofIMriBt83BDXnIUnlt0Twl-4OfXYiGCvzpFo95Q_ZeA', 'tbr': 393.785, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 426, 'height': 240, 'vcodec': 'avc1.640015', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '426x240', 'aspect_ratio': 1.77, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-393-0 - 426x240'}, {'format_id': 'hls-393-1', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/index-f4-v1-a1.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/master.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'tbr': 393.785, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 426, 'height': 240, 'vcodec': 'avc1.640015', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '426x240', 'aspect_ratio': 1.77, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-393-1 - 426x240'}, {'url': 'https://ev.phncdn.com/videos/202212/16/421533261/480P_2000K_421533261.mp4?validfrom=1714729750&validto=1714736950&rate=500k&burst=2000k&ip=143.44.168.68&ipa=143.44.168.68&hash=X%2FUNuTafPTdCPq3nWeqvVP8bvOc%3D', 'format_id': '480p', 'height': 480, 'ext': 'mp4', 'protocol': 'https', 'resolution': '480p', 'dynamic_range': 'SDR', 'aspect_ratio': None, 'filesize_approx': None, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'tbr': None, 'format': '480p - 480p'}, {'format_id': 'hls-800-0', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/480P_2000K_421533261.mp4/index-v1-a1.m3u8?scWnSPndWZctG4bTq8QwzWC4z79hZTVshvtJRvZcaXKVW5UQVTLN_NVu_Ducuc0dtFjo5i0neZ3W4NdoFVxZCTtrgvdwXaLeRWBeZQccNOSrTwboiQ3VZLb157zwZpxs4wZUPbP8USD091VMLbrCzmlrER4TzUxAx1dI3C1CfnG294rEqNc7uGTC4nzZIyixjRqGYH-TlQ', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/480P_2000K_421533261.mp4/master.m3u8?scWnSPndWZctG4bTq8QwzWC4z79hZTVshvtJRvZcaXKVW5UQVTLN_NVu_Ducuc0dtFjo5i0neZ3W4NdoFVxZCTtrgvdwXaLeRWBeZQccNOSrTwboiQ3VZLb157zwZpxs4wZUPbP8USD091VMLbrCzmlrER4TzUxAx1dI3C1CfnG294rEqNc7uGTC4nzZIyixjRqGYH-TlQ', 'tbr': 800.781, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 854, 'height': 480, 'vcodec': 'avc1.64001f', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '854x480', 'aspect_ratio': 1.78, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-800-0 - 854x480'}, {'format_id': 'hls-800-1', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/index-f3-v1-a1.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/master.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'tbr': 800.781, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 854, 'height': 480, 'vcodec': 'avc1.64001f', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '854x480', 'aspect_ratio': 1.78, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-800-1 - 854x480'}, {'url': 'https://ev.phncdn.com/videos/202212/16/421533261/720P_4000K_421533261.mp4?validfrom=1714729750&validto=1714736950&rate=500k&burst=2000k&ip=143.44.168.68&ipa=143.44.168.68&hash=E9cOTarQAJMk34xxUVnz8EJHPl4%3D', 'format_id': '720p', 'height': 720, 'ext': 'mp4', 'protocol': 'https', 'resolution': '720p', 'dynamic_range': 'SDR', 'aspect_ratio': None, 'filesize_approx': None, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'tbr': None, 'format': '720p - 720p'}, {'format_id': 'hls-1401-0', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/720P_4000K_421533261.mp4/index-v1-a1.m3u8?m9PyH1CjQ1DUPIXp10yJa4_yKhPqyIl9OTK87MI1ijDJMKWKRI7HZoh7bszQKqp7rtcEVSw_3iyxplIKSthsiosBtkGGb7EoU12WmEyWelHpI0Tc4zWO7VtokE2f26AUown0ELPfQH_gFxirU0yp5FonBTW_A3tE96arXD7lT6n5KIjvq4lFIcY17JVcu5X2XxtDoQsTog', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/720P_4000K_421533261.mp4/master.m3u8?m9PyH1CjQ1DUPIXp10yJa4_yKhPqyIl9OTK87MI1ijDJMKWKRI7HZoh7bszQKqp7rtcEVSw_3iyxplIKSthsiosBtkGGb7EoU12WmEyWelHpI0Tc4zWO7VtokE2f26AUown0ELPfQH_gFxirU0yp5FonBTW_A3tE96arXD7lT6n5KIjvq4lFIcY17JVcu5X2XxtDoQsTog', 'tbr': 1401.126, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 1280, 'height': 720, 'vcodec': 'avc1.64001f', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '1280x720', 'aspect_ratio': 1.78, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-1401-0 - 1280x720'}, {'format_id': 'hls-1401-1', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/index-f2-v1-a1.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/master.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'tbr': 1401.126, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 1280, 'height': 720, 'vcodec': 'avc1.64001f', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '1280x720', 'aspect_ratio': 1.78, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-1401-1 - 1280x720'}, {'url': 'https://ev.phncdn.com/videos/202212/16/421533261/1080P_4000K_421533261.mp4?validfrom=1714729750&validto=1714736950&rate=50000k&burst=50000k&ip=143.44.168.68&ipa=143.44.168.68&hash=TvF5DVHzCQTM5QDNw9cEzMHPAMo%3D', 'format_id': '1080p', 'height': 1080, 'ext': 'mp4', 'protocol': 'https', 'resolution': '1080p', 'dynamic_range': 'SDR', 'aspect_ratio': None, 'filesize_approx': None, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'tbr': None, 'format': '1080p - 1080p'}, {'format_id': 'hls-2041-0', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/1080P_4000K_421533261.mp4/index-v1-a1.m3u8?RFoAy8vAuiAAkUsDPgS95k-qi2MaXkOnux1OrhKR58yi47Cdo5ATm3yE2huRYXRLaqlhCnOuRPuwI2ee-DlTgpHyhFQzMqby7tPhwSvq_i1upRqeMJIKRXzfJakiAYbo4dkgJqru5bw48uCjInGtlyS3k3U8KxktqJBxBJvbNyMpLAs_ivSlWEzIo5Gui-GUtNI2AaM56w', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/1080P_4000K_421533261.mp4/master.m3u8?RFoAy8vAuiAAkUsDPgS95k-qi2MaXkOnux1OrhKR58yi47Cdo5ATm3yE2huRYXRLaqlhCnOuRPuwI2ee-DlTgpHyhFQzMqby7tPhwSvq_i1upRqeMJIKRXzfJakiAYbo4dkgJqru5bw48uCjInGtlyS3k3U8KxktqJBxBJvbNyMpLAs_ivSlWEzIo5Gui-GUtNI2AaM56w', 'tbr': 2041.092, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 1920, 'height': 1080, 'vcodec': 'avc1.640032', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '1920x1080', 'aspect_ratio': 1.78, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-2041-0 - 1920x1080'}, {'format_id': 'hls-2041-1', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/index-f1-v1-a1.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/master.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'tbr': 2041.092, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 1920, 'height': 1080, 'vcodec': 'avc1.640032', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '1920x1080', 'aspect_ratio': 1.78, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-2041-1 - 1920x1080'}], 'age_limit': 18, 'tags': ['cumswappingsis', 'holiday22', 'sex dolls', 'christmas themed', 'cum shot', 'hot blonde', 'threesome', 'kissing', 'costume', 'cum swapping', 'sofa sex', 'fingering', 'blowjob', 'doggy style', '3some', 'petite'], 'categories': ['Blonde', 'Brunette', 'Cosplay', 'FFM in Threesome', 'HD Porn', 'Pornstar', 'Small Tits', 'Threesome'], 'cast': ['Codey Steele', 'Lily Larimar', 'Molly Little'], 'subtitles': {}, 'thumbnails': [{'url': 'https://ei.phncdn.com/videos/202212/16/421533261/original/(m=qQNRH6XbeaAaGwObaaaa)(mh=UZ9s-2htnymwshtf)0.jpg', 'id': '0'}], 'timestamp': 1671218057, 'view_count': 2189805, 'webpage_url': 'https://www.pornhub.com/view_video.php?viewkey=ph639cc2cc573b8', 'original_url': 'https://www.pornhub.com/view_video.php?viewkey=ph639cc2cc573b8', 'webpage_url_basename': 'view_video.php', 'webpage_url_domain': 'pornhub.com', 'extractor': 'PornHub', 'extractor_key': 'PornHub', 'playlist': None, 'playlist_index': None, 'display_id': 'ph639cc2cc573b8', 'fulltitle': 'Naughty Elves Molly Little and Lily Larimar say, "We lost our magic.. But we have cum now!" - S3:E3', 'duration_string': '24:01', 'release_year': None, 'requested_subtitles': None, '_has_drm': None, 'epoch': 1714733350, 'format_id': 'hls-2041-1', 'format_index': None, 'url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/index-f1-v1-a1.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'manifest_url': 'https://cv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/master.m3u8?7-f11DRRcgtY1WXq19SxNeAxrCwjjOCWW3Klq9gFI6cdqkPbtuD23_tYyqA_cI2NKcIiy_CSl9A4faEsSRMY9T7I4nKhsWexYgckxrlBULW9CLpTBPyJG3km22uUvwxZbfLUkdF9vC6TFvFaTsURknd2Xn55A5oW_8NsP3LPmY_SydTTy2KBEKC4bo7aHdceC9qgDPlmtg', 'tbr': 2041.092, 'ext': 'mp4', 'fps': 29.97, 'protocol': 'm3u8_native', 'preference': None, 'quality': None, 'has_drm': False, 'width': 1920, 'height': 1080, 'vcodec': 'avc1.640032', 'acodec': 'mp4a.40.2', 'dynamic_range': 'SDR', 'resolution': '1920x1080', 'aspect_ratio': 1.78, 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}, 'video_ext': 'mp4', 'audio_ext': 'none', 'vbr': None, 'abr': None, 'format': 'hls-2041-1 - 1920x1080'}

in this print response, there is mp4 URL, that I wanted to open/download in the browser directly.

If i Use your given command

 yt-dlp -vU "https://www.pornhub.com/view_video.php?viewkey=ph639cc2cc573b8"
[debug] Command-line config: ['-vU', 'https://www.pornhub.com/view_video.php?viewkey=ph639cc2cc573b8']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp-nightly-builds [ac817bc83] (pip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - macOS-10.16-x86_64-i386-64bit (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-1.26.18, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp-nightly-builds)
[PornHub] Extracting URL: https://www.pornhub.com/view_video.php?viewkey=ph639cc2cc573b8
[PornHub] ph639cc2cc573b8: Downloading pc webpage
[PornHub] ph639cc2cc573b8: Downloading m3u8 information
[PornHub] ph639cc2cc573b8: Downloading m3u8 information
[PornHub] ph639cc2cc573b8: Downloading m3u8 information
[PornHub] ph639cc2cc573b8: Downloading m3u8 information
[PornHub] ph639cc2cc573b8: Downloading m3u8 information
[PornHub] ph639cc2cc573b8: Downloading JSON metadata
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: best/bestvideo+bestaudio
[info] ph639cc2cc573b8: Downloading 1 format(s): hls-2041-1
[debug] Invoking hlsnative downloader on "https://hv-h.phncdn.com/hls/videos/202212/16/421533261/,1080P_4000K,720P_4000K,480P_2000K,240P_1000K,_421533261.mp4.urlset/index-f1-v1-a1.m3u8?h=kFGrF%2FQncVy1OuhsWnzLrbPHA9Y%3D&e=1714737833&f=1"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 360
[download] Destination: Naughty Elves Molly Little and Lily Larimar say, "We lost our magic.. But we have cum now!" - S3:E3 [ph639cc2cc573b8].mp4
[download]  20.5% of ~ 343.15MiB at  551.90KiB/s ETA 08:36 (frag 74/360)

@dirkf
Copy link
Contributor

dirkf commented May 3, 2024

To check the URL that you appear to have used (as far as the unhelpful screenshot shows), add a format selection option -f 240p to the command.

@PankajSavaliya
Copy link
Author

PankajSavaliya commented May 3, 2024

To check the URL that you appear to have used (as far as the unhelpful screenshot shows), add a format selection option -f 240p to the command.

I didn't get you!, can you please explain more, as my concern is download mp4 directly from URL from info, not from m3u8 URL using yt-dlp with download = true

just try with I have given URL, there is mp4 URL like this, might this URL is expired so generated new one from given python code snippt.

@dirkf
Copy link
Contributor

dirkf commented May 3, 2024

That is, run the yt-dlp command ("your given command") with that additional option. That will show that whether the extracted data is sufficient to get the media file without 403. If it is, then review the linked FAQ answer.

@PankajSavaliya
Copy link
Author

That is, run the yt-dlp command ("your given command") with that additional option. That will show that whether the extracted data is sufficient to get the media file without 403. If it is, then review the linked FAQ answer.

Just give me an example of my URL with cookies or any required option that needs to be added in the header. I'm a bit confused based on the FAQ, I understood there are many dependencies for directly using URL in browser, but please help me if it possible.

 yt-dlp -vU "https://www.pornhub.com/view_video.php?viewkey=ph639cc2cc573b8"

@bashonly
Copy link
Member

bashonly commented May 3, 2024

Are you extracting the mp4 URL on a machine with a different IP address than the machine you are trying to load the URL in your browser with?

The mp4 URL is tied to IP address. If you try to load that URL from a different IP, you will get the unauthorized error.

@PankajSavaliya
Copy link
Author

PankajSavaliya commented May 5, 2024

@bashonly No, I used the same IP address while extracting info and loading the mp4 URL on browser! I have checked this case on starting.

Just try with the given URL and see what result you will get at your end!

@pukkandan
Copy link
Member

@PankajSavaliya We seem to be talking past each other. Please read this carefully.

Format URL that yt-dlp provides is NOT always expected to load in browser as explained in https://github.com/yt-dlp/yt-dlp/wiki/FAQ#i-extracted-a-video-url-but-it-does-not-play-on-another-machine--in-my-web-browser. If that is your only issue, there is nothing to be done.

If you also cannot download it with yt-dlp directly, you may provide verbose logs of the error to reopen the issue.

@pukkandan pukkandan closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete Further information is needed NSFW question Question
Projects
None yet
Development

No branches or pull requests

4 participants