Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: April 24, 2024, 12:57 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP Locally
#11
RE: PHP Locally
Dar - unfortunately I'm buried at the moment, and somewhat handicapped by virtue of the fact that my C development platform is on Linux.
Reply
#12
RE: PHP Locally
(June 7, 2012 at 4:31 pm)Cthulhu Dreaming Wrote: Dar - unfortunately I'm buried at the moment, and somewhat handicapped by virtue of the fact that my C development platform is on Linux.

Never mind. I'll just have to stop being lazy and work it out for myself Big Grin
[Image: cinjin_banner_border.jpg]
Reply
#13
RE: PHP Locally
Darwinian: Looking into this a bit further, it seems this is the Holy Grail you need:

http://youtube.com/get_video_info?video_id=XZxo7IznQnk
Reply
#14
RE: PHP Locally
Is that right? The link is trying to get me to download an 'Unknown File Type' :S

Edit: Oh, hang on, just seen my mistake..
[Image: cinjin_banner_border.jpg]
Reply
#15
RE: PHP Locally
Looks like you have to URL Decode the data, which then becomes this:

Code:
account_playback_token=&url_encoded_fmt_stream_map=url=http://o-o.preferred.adnet-otp1.v21.lscache3.c.youtube.com/videoplayback?upn=mzgH_FEzrBo&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&fexp=906717,907217,907335,921602,919306,919316,912804,913542,919324,912706&ms=au&itag=43&ip=109.0.0.0&signature=222E68A2BE474B57B962F58DD79EEBA277F54EC2.6EA60B5CFFAE0CB3EA6CFC20B0208309AF088011&sver=3&mt=1339101612&ratebypass=yes&source=youtube&expire=1339124260&key=yt1&ipbits=8&cp=U0hSTlFNUl9LSkNOMl9JR1ZDOldSeXRYREViUmlV&id=5d9c68ec8ce74279&quality=medium&fallback_host=tc.v21.cache3.c.youtube.com&type=video/webm; codecs="vp8.0, vorbis"&itag=43,url=http://o-o.preferred.adnet-otp1.v20.lscache4.c.youtube.com/videoplayback?upn=mzgH_FEzrBo&sparams=algorithm,burst,cp,factor,id,ip,ipbits,itag,source,upn,expire&fexp=906717,907217,907335,921602,919306,919316,912804,913542,919324,912706&mt=1339101612&ms=au&algorithm=throttle-factor&itag=34&ip=109.0.0.0&burst=40&sver=3&signature=D82F0C03580A7BB14196C0FA3AC6499001C3EA01.25D4D46C05177B70C3D41D191DF49AC462C064E8&source=youtube&expire=1339124260&key=yt1&ipbits=8&factor=1.25&cp=U0hSTlFNUl9LSkNOMl9JR1ZDOldSeXRYREViUmlV&id=5d9c68ec8ce74279&quality=medium&fallback_host=tc.v20.cache4.c.youtube.com&type=video/x-flv&itag=34,url=http://o-o.preferred.adnet-otp1.v21.lscache6.c.youtube.com/videoplayback?upn=mzgH_FEzrBo&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&fexp=906717,907217,907335,921602,919306,919316,912804,913542,919324,912706&ms=au&itag=18&ip=109.0.0.0&signature=C1DBF533421028D7A5DFACD4C80CD09023E74140.A18FC247ED5332CD29CA975CD214A1C2D8246341&sver=3&mt=1339101612&ratebypass=yes&source=youtube&expire=1339124260&key=yt1&ipbits=8&cp=U0hSTlFNUl9LSkNOMl9JR1ZDOldSeXRYREViUmlV&id=5d9c68ec8ce74279&quality=medium&fallback_host=tc.v21.cache6.c.youtube.com&type=video/mp4; codecs="avc1.42001E, mp4a.40.2"&itag=18,url=http://o-o.preferred.adnet-otp1.v14.lscache3.c.youtube.com/videoplayback?upn=mzgH_FEzrBo&sparams=algorithm,burst,cp,factor,id,ip,ipbits,itag,source,upn,expire&fexp=906717,907217,907335,921602,919306,919316,912804,913542,919324,912706&mt=1339101612&ms=au&algorithm=throttle-factor&itag=5&ip=109.0.0.0&burst=40&sver=3&signature=5A00AD7538B7372F989ACD32B21E36171D3CD206.B475AD3BCF0D29F4F848662151E4CC53DCC2F53A&source=youtube&expire=1339124260&key=yt1&ipbits=8&factor=1.25&cp=U0hSTlFNUl9LSkNOMl9JR1ZDOldSeXRYREViUmlV&id=5d9c68ec8ce74279&quality=small&fallback_host=tc.v14.cache3.c.youtube.com&type=video/x-flv&itag=5,url=http://o-o.preferred.adnet-otp1.v21.lscache2.c.youtube.com/videoplayback?upn=mzgH_FEzrBo&sparams=algorithm,burst,cp,factor,id,ip,ipbits,itag,source,upn,expire&fexp=906717,907217,907335,921602,919306,919316,912804,913542,919324,912706&mt=1339101612&ms=au&algorithm=throttle-factor&itag=36&ip=109.0.0.0&burst=40&sver=3&signature=B643C94ED8C53D6BA68255935FE7B3A1C72EF286.058BF70DB83B8CF08B8508F904E63AD828BC1616&source=youtube&expire=1339124260&key=yt1&ipbits=8&factor=1.25&cp=U0hSTlFNUl9LSkNOMl9JR1ZDOldSeXRYREViUmlV&id=5d9c68ec8ce74279&quality=small&fallback_host=tc.v21.cache2.c.youtube.com&type=video/3gpp&itag=36&allow_embed=1&vq=auto&fexp=906717,907217,907335,921602,919306,919316,912804,913542,919324,912706&allow_ratings=1&keywords=Skydiving,helicopter,extreme,diving&track_embed=1&view_count=1680836&video_verticals=[554, 20, 999]&fmt_list=43/320x240/99/0/0,34/320x240/9/0/115,18/320x240/9/0/115,5/320x240/7/0/0,36/320x240/99/0/0&author=pianojosh&muted=0&length_seconds=78&has_cc=False&tmi=1&ftoken=&status=ok&tabsb=1&watermark=,https://s.ytimg.com/yt/img/watermark/youtube_watermark-vflHX6b6E.png,https://s.ytimg.com/yt/img/watermark/youtube_hd_watermark-vflAzLcD6.png&timestamp=1339101730&storyboard_spec=https://i1.ytimg.com/sb/XZxo7IznQnk/storyboard3_L$L/$N.jpg|48#27#100#10#10#0#default#4-FNWJkuFJPZF6gahJCVzCYyIog|60#45#80#10#10#1000#M$M#ZMf70gtkmhuVtJogO79EIjCL3FY|120#90#80#5#5#1000#M$M#Rv1CKiKw5m9DolrTk0mn5DxCj7s&plid=AATB5-rwUwK8YGBl&endscreen_module=https://s.ytimg.com/yt/swfbin/endscreen-vflwh2zaW.swf&hl=en_US&no_get_video_log=1&avg_rating=4.94446139762&video_id=XZxo7IznQnk&sendtmp=1&token=vjVQa1PpcFMdLaCRfCMI6gAZVNXTRYd2S0nxEOudCQE=&thumbnail_url=https://i1.ytimg.com/vi/XZxo7IznQnk/default.jpg&title=Extreme Skydiving

I'm guessing one of those URLs is the one for the FLV file.
Reply
#16
RE: PHP Locally
Its retarded to include an entire damn interpreter for a stupid php script.

Do it natively or not at all.

Interpreters aren't free (computationally wise).

Though, if you really want to use PHP, you can use HipHop to transpile it to C++.

http://en.wikipedia.org/wiki/HipHop_for_PHP
Slave to the Patriarchy no more
Reply
#17
RE: PHP Locally
Since YouTube can't be relied on for keeping this method the same, might I suggest that if you want to encorporate something like this, you do the following:

1) Have a server which translates a YouTube URL into the FLV URL.
2) Have your media player query your server for the FLV URL.
3) Have your media player do all the downloading with the FLV URL it got.

That way, your server is doing a simple calculation rather than some intensive process like downloading a video file, and you can change the process by which you get the FLV URL if YouTube ever decide to do that, meaning that your users won't have to reinstall your media player.
Reply
#18
RE: PHP Locally
That wastes bandwidth.

Better to build a program that uses a schema to intepret youtube's syntax and hash several identifiers.

When the hash changes, we know youtube (or the data) is changed/bad and signals a fetch from Darwinian's servers for an updated schema or "update the world" message.
Slave to the Patriarchy no more
Reply
#19
RE: PHP Locally
(June 7, 2012 at 6:44 pm)Moros Synackaon Wrote: That wastes bandwidth.

Better to build a program that uses a schema to intepret youtube's syntax and hash several identifiers.

When the hash changes, we know youtube (or the data) is changed/bad and signals a fetch from Darwinian's servers for an updated schema or "update the world" message.

I'm not sure this is necessary at the moment.

Provided that Darwinian is comfortable in the assumption that get_video_info will reliably return the URL of the video stream in the url element, it shouldn't be necessary to care about the other return elements.
Reply
#20
RE: PHP Locally
Bullshit. My company is infested with "good enough" fixes.

If you're going to do it, do it partially right. Else don't.

It's called technical debt. And it mounts fast.

Also, WHAT possible issue can using Hiphop entail while querying a server and incurring a round trip delay would solve?

Edit: I just realized you were referring to Youtube's unstable API instead of the other suggested fixes, including my criticism of querying a server for video info,. Oops.
Slave to the Patriarchy no more
Reply





Users browsing this thread: 1 Guest(s)