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

The extractor does not work in my server but works well in my localhost #24943

Closed
shiyue66 opened this issue Apr 22, 2020 · 2 comments
Closed

The extractor does not work in my server but works well in my localhost #24943

shiyue66 opened this issue Apr 22, 2020 · 2 comments
Labels

Comments

@shiyue66
Copy link

@shiyue66 shiyue66 commented Apr 22, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.24
  • 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 bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

Description

I created a Django project to extract video URL from pornhub.

The extracted video URL I get directly from locahost works well, but after I deploy my codes, the url I get from server does not work. When I open the url, it shows "403 - Forbidden"

Here are codes:
ydl_opts = { 'format': 'best', 'nooverwrites': True, 'no_warnings': False, 'ignoreerrors': True, }

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    url = "https://www.pornhub.com/view_video.php?viewkey={}".format(
        video_id)
    res = ydl.extract_info(url, download=False)
    logging.warning("res", res)
print(res[url])

Example:
Website url: http://127.0.0.1:8000/tiktok/video/videoURL/ph5c77e0b836386

Result from localhost:
https://dv-h.phncdn.com/hls/videos/201902/28/210403291/,480P_2000K,240P_400K,_210403291.mp4.urlset/index-f1-v1-a1.m3u8?ttl=1587561021&l=0&hash=70e4f679d4da55a5812adca6aa110890

Result from deployed machine:
https://c1v-h.phncdn.com/hls/videos/201902/28/210403291/,480P_2000K,240P_400K,_210403291.mp4.urlset/index-f1-v1-a1.m3u8?5WCQ17D5_pWVJZoQc9oNNsR0OhHEAvpzClTwnnORebXS_6kAEWeQmrNhI1ncVcUwlSfiXkg2fM5iwD7Mb8ROEiiUzf9SJkSGx_ZwAqqMi90QBA6YxgTJrymbi04k-yDyiEb7b4Qall4YwtAyjnlGSCSLnF-38HunXs5isZhFu_GCb71qryJOcxxj7FicSlK1yMElDpRDnKrYWUvD4mzd

Does anyone has ideas about this case? Is this related IP address? Thanks a lot!

@dstftw dstftw closed this Apr 22, 2020
@dstftw dstftw added the incomplete label Apr 22, 2020
@shiyue66
Copy link
Author

@shiyue66 shiyue66 commented Apr 22, 2020

@dstftw , Sorry but could you please reopen my case? Actually the video URL can be extracted, but it just can not be opened in browser correctly, so no obvious error log.

@shiyue66
Copy link
Author

@shiyue66 shiyue66 commented Apr 22, 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.

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