Downloading Premium Videos via API

Avatar image for adam2marsh
adam2marsh

21

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By adam2marsh

Evening All,

I'm in the process of creating a PHP WebApp (runs locally on PI) which downloads videos overnight (poor download speeds) so I can then transfer quickly onto Mac before the commute.

Everything was working fine until today when I can't download the premium videos, now I always thought it was weird as never attached my API key to the request but it would download. Now I get the error video advising couldn't authenticate me.

Thanks,
Adam

Avatar image for adam2marsh
adam2marsh

21

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

I had a search and was unable to find much information.... I'm assuming I need to perform authentication but unsure:

- exactly why it has just changed?

- also how to authenticate, can I send a post to giant bomb with credentials.

Thanks

Avatar image for szlifier
szlifier

1518

Forum Posts

120

Wiki Points

0

Followers

Reviews: 0

User Lists: 4

#3  Edited By szlifier

@adam2marsh: There's a big change happening to how videos are served. More info here.

Here's a quote from that:

If its 3 or 4, You're going to need to append your API key to the video url or the RSS feed like this:

http://v.giantbomb.com/video.mp4?api_key=aaabbb111

Please note, you'll be limited to 20 video downloads a day downloaded this way.

For now it seems like the only way of doing what you want. I also do it this way and it's fine.

Avatar image for adam2marsh
adam2marsh

21

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#4  Edited By adam2marsh

Thanks @szlifier, I remember reading that a while ago and as working never went and followed its advice.

Went ahead and made the change so now my API Key is being appended to my video my request but I'm still having the same issue, it downloads the authentication error video. Tried running as a wget and same problem so I at least know its not my code now :S Worth sending an email with the example wget I'm using?

Avatar image for szlifier
szlifier

1518

Forum Posts

120

Wiki Points

0

Followers

Reviews: 0

User Lists: 4

#5  Edited By szlifier

@adam2marsh: It should work with just the api key attached. Can you check if it's actually in the GET query (e.g. in Wireshark)?

There's another thing that may affect you, but that would get you HTTP 403 an not the error video.

You have to send a custom User Agent header (can't be wget's default or empty). You can just put your username there - something that identifies you.

Like this:

wget --user-agent="Adam2Marsh fancy script" ...(the rest of the query)
Avatar image for adam2marsh
adam2marsh

21

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@szlifier Thank you! that was it! :)

Set the User Agent on the wget with the api key and it downloaded the video. Made the Api Key change to my app, just need to try setting the php user-agent which handily can be set globally in the ini file which is perfect to test and can look at a better way afterwards.

Thanks for all your help! Really appreciate it!

Avatar image for szlifier
szlifier

1518

Forum Posts

120

Wiki Points

0

Followers

Reviews: 0

User Lists: 4

@adam2marsh: Cool. I'm glad I could help a fellow Duder.

Avatar image for tsigo
tsigo

125

Forum Posts

165

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

@szlifier Thanks for the note about the user agent, that was the last piece of the puzzle!

Avatar image for adam2marsh
adam2marsh

21

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Incase anyone is developing a PHP app and having these problems I solved by adding in the following line before streaming the video to be saved:

ini_set("user_agent","Adam2Marsh Laravel Video Downloader PI");

Avatar image for flamingmonky
Flamingmonky

6

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Hello, I am having similar problems.

I have a python script that has stopped working and I am trying to work out what I am doing wrong. I append to API key so I will have a url like so.

http://v.giantbomb.com/2016/03/31/vf_killerinstinctseason3_ql_033116_4000.mp4&api_key=[my api key]

If I dump it in my browser I get "File not found." I then tried it with wget adding the user agent as you suggested and that gets me closer as this time it finds a file but gives me the you aren't authorised to view this video.

wget --user-agent="Flamingmonky" http://v.giantbomb.com/2016/03/31/vf_killerinstinctseason3_ql_033116_4000.mp4&api_key=[my api key]

Am I missing a wget arg or is this another issue?

Avatar image for szlifier
szlifier

1518

Forum Posts

120

Wiki Points

0

Followers

Reviews: 0

User Lists: 4

Avatar image for flamingmonky
Flamingmonky

6

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@szlifier: Well I feel silly :)

That did of course fix it, thank you very much!

Avatar image for tsigo
tsigo

125

Forum Posts

165

Wiki Points

0

Followers

Reviews: 0

User Lists: 5

#14  Edited By tsigo

Just a heads up, it seems something changed recently where the RSS feeds now include the `?api_key=[whatever]` parameter in the URL for every video, so if you were manually appending that value to the link passed to your downloader, like I was with wget, you'll be downloading the "This is an error message!" video.

Avatar image for wcarle
wcarle

447

Forum Posts

54

Wiki Points

0

Followers

Reviews: 0

User Lists: 1