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

Unable to get the correct url #1

Open
aornano opened this issue Aug 31, 2017 · 3 comments
Open

Unable to get the correct url #1

aornano opened this issue Aug 31, 2017 · 3 comments

Comments

@aornano
Copy link

aornano commented Aug 31, 2017

There are many videos like this one:
http://www.youtube.com/get_video_info?video_id=3tmd-ClpJxA

that get an incorrect url, so after you make for example:

do {
        let maps = try FormatStreamMapFromString(result)
        if let map = maps.first {
             print(map.url)
        }
} catch {
             print(error)
             XCTFail()
 }

The url showed is:

https://r2---sn-fpoq-o52l.googlevideo.com/videoplayback?expire=1504223715&mime=video/3gpp&requiressl=yes&clen=7133253&ipbits=0&itag=36&mm=31&lmt=1503878433351096&mv=m&gir=yes&mt=1504202027&ms=au&id=o-AHBRjxQ34NxPIarpiVuuv1kQHoMbNz6ObC2pdw1bHjAj&ei=g02oWeWMH8W4WYzui7AC&pl=17&source=youtube&dur=255.698&ip=151.43.5.143&key=yt6&mn=sn-fpoq-o52l&sparams=clen,dur,ei,gir,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pl,requiressl,source,expire&initcwndbps=612500

And get the following message:

Access denied:
You don't have authorisation to view this page.

HTTP ERROR 403

@sonsongithub
Copy link
Owner

I suppose that this video is not public.
I tried to get video stream URL of "https://www.youtube.com/get_video_info?video_id=xOvSwdi5dr4" and I could get the correct one.

@aornano
Copy link
Author

aornano commented Sep 1, 2017

It could be correct (I can see this video video_id=3tmd-ClpJxA also without access to youtube..), but there are too many videos that report this problem:

video_id=72UO0v5ESUo
video_id=3NmGGGlHpxQ
video_id=vSW2M-BB1NE

and I can continue for many other videos..
I suspect the first url when you get video information have not enough parameters.
I think we could focus attention about 3 different cases:

  • unrestricted Videos
  • restricted Videos like Vevo, T-Series or other brands
  • age-Restricted Videos
    I mean, something like this script

@sonsongithub
Copy link
Owner

I don't know how to handle the 3 cases....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants