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

return FLV instead of MP4 #1568

Closed
coolboy444 opened this issue Oct 6, 2013 · 6 comments
Closed

return FLV instead of MP4 #1568

coolboy444 opened this issue Oct 6, 2013 · 6 comments

Comments

@coolboy444
Copy link

@coolboy444 coolboy444 commented Oct 6, 2013

Hi all!

i try download video itag=18 - MP4 640 x 360 e.g.

http://r7---sn-gvnuxaxjvh-v8ce.c.youtube.com/videoplayback?fallback_host=tc.v16.cache1.c.youtube.com&type=video/mp4; codecs="avc1.42001E, mp4a.40.2"&quality=medium&itag=18&cp=U0hXRlFNT19MTUNON19JR1NKOkFpUGMxeUozM0tm&upn=fTTJUjjf0gg&ip=176.59.181.112&key=yt5&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&ipbits=8&expire=1381121973&sver=3&source=youtube&fexp=904448,903903,922222,932200,916807,932912,916611,924606,924616,916914,929141,929117,929121,929906,929907,929922,929923,929127,929129,929131,929930,936403,925724,925726,936310,925720,925722,925718,936401,925714,929917,906945,929933,929935,929937,929939,939602,939604,937102,906842,913428,920605,912715,919811,939908,935704,932309,913563,901812,919373,930803,908538,904839,932211,934003,934004,931924,938608,940501,936308,939201,900816,912711,916304,900391,934507,907231,936312,906001&id=3c36fa16f7d0a0b3&ratebypass=yes&ms=au&mt=1381099711&mv=m&signature=548793096FC85EDE010E028FF2007F0FFB9AEF95.8D22D451F69EFC1F195A1B3346C34C62E88B49CC

But i receive FLV file...

HTTP/1.1 200 OK
Date: Sun, 06 Oct 2013 22:52:40 GMT
Server: gvs 1.0
Last-Modified: Mon, 16 Sep 2013 23:33:39 GMT
Content-Type: video/mp4
Expires: Sun, 06 Oct 2013 22:52:40 GMT
Cache-Control: private, max-age=21713
Accept-Ranges: none
Content-Length: 45126226
Alternate-Protocol: 80:quic
X-Content-Type-Options: nosniff
X-Vent-VVO: TRANSCODED
X-VVO-XCODE: I_482_H264_386_AAC_96_O_libx264_160_copy_96_DEFAULT
X-VVO-OBR: 256000
Connection: close

FLV�� � �5 �
onMetaData� �
canseeko

i amazing... Content-Type: video/mp4 but return FLV file...

this strange headers appended when FLV file receive instead of MP4

X-Vent-VVO: TRANSCODED
X-VVO-XCODE: I_482_H264_386_AAC_96_O_libx264_160_copy_96_DEFAULT
X-VVO-OBR: 256000

why this occurs ?

thanks

@phihag
Copy link
Contributor

@phihag phihag commented Oct 6, 2013

Can you post the entire output of youtube-dl when called with the -v option? Also, with which ISP(s) are you seeing this?

@coolboy444
Copy link
Author

@coolboy444 coolboy444 commented Oct 6, 2013

C:>youtube-dl -v -g -f 18 http://www.youtube.com/watch?v=8rOMX-2wDEc
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-g', '-f', '18', 'http://www.youtube.com/watc
h?v=8rOMX-2wDEc']
[debug] youtube-dl version 2013.10.04
[debug] Python version 2.7.5 - Windows-XP-5.1.2600-SP2
[debug] Proxy map: {}
http://r4---sn-gvnuxaxjvh-3w5e.c.youtube.com/videoplayback?ipbits=8&cp=U0hXRlFNU19HU0NON19JR1dBOkktMjZyUWxaazJG&ms=au&id=f2b38c5fedb00c47&source=youtube&ratebypass=yes&expire=1381125029&key=yt1&ip=176.59.181.112&mt=1381103317&sver=3&upn=rfr-H86Tm-A&fexp=919122%2C914024%2C916613%2C924606%2C924616%2C916914%2C929117%2C929121%2C929906%2C929907%2C929922%2C929923%2C929127%2C929129%2C929131%2C929930%2C936403%2C925724%2C925726%2C936310%2C925720%2C925722%2C925718%2C936401%2C925714%2C929917%2C906945%2C929933%2C929935%2C929937%2C929939%2C939602%2C939604%2C937102%2C906842%2C913428%2C912715%2C919811%2C939908%2C935704%2C932309%2C913563%2C919373%2C930803%2C908538%2C934003%2C934004%2C931924%2C938608%2C940501%2C936308%2C935006%2C939201%2C900816%2C912711%2C916304%2C934903%2C900391%2C934507%2C907231%2C936312%2C906001&sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&mv=m&itag=18&signature=7A8158663C2AABDAED6B731FB79C337DFABB1E77.A59494841ABFD9FCF41CD82A61EA91F511DA0517

ok copy link in download manager and sniff requests

GET /videoplayback?ipbits=8&cp=U0hXRlFNU19HU0NON19JR1dBOkktMjZyUWxaazJG&ms=au&id=f2b38c5fedb00c47&source=youtube&ratebypass=yes&expire=1381125029&key=yt1&ip=176.59.181.112&mt=1381103317&sver=3&upn=rfr-H86Tm-A&fexp=919122%2C914024%2C916613%2C924606%2C924616%2C916914%2C929117%2C929121%2C929906%2C929907%2C929922%2C929923%2C929127%2C929129%2C929131%2C929930%2C936403%2C925724%2C925726%2C936310%2C925720%2C925722%2C925718%2C936401%2C925714%2C929917%2C906945%2C929933%2C929935%2C929937%2C929939%2C939602%2C939604%2C937102%2C906842%2C913428%2C912715%2C919811%2C939908%2C935704%2C932309%2C913563%2C919373%2C930803%2C908538%2C934003%2C934004%2C931924%2C938608%2C940501%2C936308%2C935006%2C939201%2C900816%2C912711%2C916304%2C934903%2C900391%2C934507%2C907231%2C936312%2C906001&sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&mv=m&itag=18&signature=7A8158663C2AABDAED6B731FB79C337DFABB1E77.A59494841ABFD9FCF41CD82A61EA91F511DA0517 HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)
Host: r4---sn-gvnuxaxjvh-3w5e.c.youtube.com
Accept: /
Referer: http://r4---sn-gvnuxaxjvh-3w5e.c.youtube.com/
Cookie: PREF=f1=50000000; VISITOR_INFO1_LIVE=2Y59E9Hpl-8

HTTP/1.1 200 OK
Date: Sun, 06 Oct 2013 23:49:49 GMT
Server: gvs 1.0
Last-Modified: Thu, 25 Apr 2013 22:29:08 GMT
Content-Type: video/mp4
Expires: Sun, 06 Oct 2013 23:49:49 GMT
Cache-Control: private, max-age=21340
Accept-Ranges: none
Content-Length: 15715580
Alternate-Protocol: 80:quic
X-Content-Type-Options: nosniff
X-Vent-VVO: TRANSCODED
X-VVO-XCODE: I_389_H264_294_AAC_95_O_libx264_96_copy_95_DEFAULT
X-VVO-OBR: 191000
Connection: close

FLV�� � �5 �
onMetaData� �
canseekon

as see FLV returned instead MP4....

inetnum: 176.59.128.0 - 176.59.255.255
netname: BWC-INET
descr: CJSC Baykalwestcom
country: RU
admin-c: BWC
tech-c: BWC
status: ASSIGNED PA
mnt-by: BWC-MNT
source: RIPE # Filtered

@coolboy444
Copy link
Author

@coolboy444 coolboy444 commented Oct 7, 2013

C:>youtube-dl -v -f 18 http://www.youtube.com/watch?v=8rOMX-2wDEc
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-f', '18', 'http://www.youtube.com/watch?v=8r
OMX-2wDEc']
[debug] youtube-dl version 2013.10.04
[debug] Python version 2.7.5 - Windows-XP-5.1.2600-SP2
[debug] Proxy map: {}
[youtube] Setting language
[youtube] 8rOMX-2wDEc: Downloading video webpage
[youtube] 8rOMX-2wDEc: Downloading video info webpage
[youtube] 8rOMX-2wDEc: Extracting video information
[download] Destination: ╠╚╒└╚╦ ╩╨╙├ - ╩╬╦▄┘╚╩-8rOMX-2wDEc.mp4
[download] 1.8% of 14.99MiB at 10.23KiB/s ETA 24:33
ERROR: Interrupted by user

open МИХАИЛ КРУГ - КОЛЬЩИК-8rOMX-2wDEc.mp4.part in hex editor

Offset 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

00000000 46 4C 56 01 05 00 00 00 09 00 00 00 00 12 00 01 FLV.............
00000016 35 00 00 00 00 00 00 00 02 00 0A 6F 6E 4D 65 74 5..........onMet
00000032 61 44 61 74 61 08 00 00 00 0E 00 0D 63 61 6E 73 aData.......cans
00000048 65 65 6B 6F 6E 74 69 6D 65 01 01 00 08 64 75 72 eekontime....dur
00000064 61 74 69 6F 6E 00 40 73 F0 00 00 00 00 00 00 0D ation.@sð.......
00000080 74 6F 74 61 6C 64 75 72 61 74 69 6F 6E 00 40 73 totalduration.@s
00000096 F0 00 00 00 00 00 00 05 77 69 64 74 68 00 40 7E ð.......width.@~
00000112 00 00 00 00 00 00 00 06 68 65 69 67 68 74 00 40 ........height.@
00000128 76 80 00 00 00 00 00 00 0D 76 69 64 65 6F 64 61 v€.......videoda
00000144 74 61 72 61 74 65 00 40 57 70 00 00 00 00 00 00 tarate.@WP......
00000160 09 66 72 61 6D 65 72 61 74 65 00 40 32 00 00 00 .framerate.@2...

i amazing....

@phihag
Copy link
Contributor

@phihag phihag commented Oct 7, 2013

As I suspected, your ISP is meddling with YouTube videos (probably recoding them to a lower quality to save bandwidth). What happens if you replace http: in the final URL with https:?

@coolboy444
Copy link
Author

@coolboy444 coolboy444 commented Oct 7, 2013

403 Forbidden

moreover sometimes returned mp4 file but sometimes flv... seems this randomly occurs

@phihag
Copy link
Contributor

@phihag phihag commented Jan 22, 2015

We now use https by default, so your ISP cannot meddle with the downloaded files.

@phihag phihag closed this Jan 22, 2015
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.