Originally Posted By: Virtual1
Originally Posted By: plantsower
Originally Posted By: MacManiac
The link you want to send to your friend is at the very end of all the data you got (following the comma).....

https://www.youtube.com/watch?v=UnTwiQY2hcM


Thank you! I tried it with another video but couldn't find a comma or anything. Would you tell me where to look on this one? I have another one that looks like this, too.


There are a few ways to pack data into a url. The idea is that the first part of it takes you to the web server, where the server sees the path and cuts off the start and parses some data from it and continues based on that information. (or just records it with the log of the web hit, for metrics or analytics or paying their advertisers etc)

Since there's a few different things they can do (sequentially, or in depth) you sometimes have to peel it apart a bit at a time. First thing to do is break up the parts separated by the initial ? and any & that follow


Code:
https://r6---sn-n4v7sn7s.googlevideo.com/videoplayback
clen=23851415
ei=x3_dWOayGtHX-wPZ-b_QAg
ms=au
mt=1490911048
mv=m
expire=1490932775
requiressl=yes
ipbits=0
mm=31
mn=sn-n4v7sn7s
id=o-AN8ixjr4UzU4qkYW9OpzHqslk7X5QYn5Zhw_DvKw_a0M
itag=18
key=yt6
ip=65.49.67.245
dur=311.890
lmt=1337682685488623
upn=ot96VyRAwxE
mime=video%2Fmp4
sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire
signature=9814CC08AAEBC7B33EA6EFB911671027FD9EA570.8126587DB897C21747AB5BF909DF05B62793


So you can see this is just a list of posting parameters. Now they're restricted on what they can put in for values due to the limits of URL formats (though seemingly not LENGTH!!) so they encode it. Percents are made for hex values and other times they just block encode chunks of binary data. ei, id, and upn are probably some unique key format. mime is "video/mp4" (because $2F is "/"). There are a lot of 2C (",") in sparams, which is slightly more readable as "clen,dur,ei,gir,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pl,ratebypass,requiressl,source,upn,expire". (curiously enough, that's actually a list of the above parameters... interesting!) Signature looks like a hex dump but is strange that it's an odd number of characters. (77)

MANY urls you can just trim off the added junk. For example, if you try to copy a youtube link in most places, you'll get a big mess that starts with "https://www.youtube.com/watch?v=xxxxxxxxxxxxxx" followed by & and a bunch of trash. You can just delete the rest before reposting the link in its much smaller format. You probably don't need the rest, it's usually advertiser tracking. Sometimes it's preferences or settings though, like it may throw you automatically into fullscreen playback or start the video at a specific point etc.


Thank you for that explanation. smile


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8