Jump to content

Twitch API problems

babadoctor

Hi

 

I am trying to write a script to interact with Twitch's API, and I am having a lot of problems.

I couldn't get the script to work, no matter how much I read the documentation...

 

 

What it was supposed to accomplish:

  •  Get VOD ID's of streams that were streamed in the last 24 hours.
  •  Pass that to a bash variable (I know how to do this part)

 

I have tried this so far:

https://hastebin.com/fisajunoci.nginx 

 

 

I also tried following this tutorial, to no avail:

https://www.johannesbader.ch/2014/01/find-video-url-of-twitch-tv-live-streams-or-past-broadcasts/ 

 

 

Documentation I have read so far:

https://dev.twitch.tv/docs/v5/reference/videos/ 

https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-videos

https://dev.twitch.tv/docs/v5/reference/channels/

http://archive.is/JfofO (I don't know why this webpage was deleted from github, but I archived the google cache)

 

 

Other links I have visited that may help

https://discuss.dev.twitch.tv/t/last-videos-from-specific-channels/6626

https://stackoverflow.com/questions/28412218/get-latest-youtube-and-twitch-video-url-from-channel-js-jquery

 

 

I also took a wget approach

https://stackoverflow.com/questions/2804467/spider-a-website-and-return-urls-only

https://opendata.stackexchange.com/questions/4851/exclusion-lists-when-crawling-web-directories

This was fruitless too

 

 

Can anyone help me...? Please...

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

The only thing I can see wrong with that is where you're sending your request (if you're using the right oAuth token). The twitch API endpoint is at api.twitch.tv/kraken not api.twitch.tv/api. So to get the info about the channel you would use https://api.twitch.tv/kraken/channels/<channel ID> where channel id is represented as the new numerical id rather than the username. To do this you can query the users endpoint using the username, and that will return the numerical client id

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×