Skip to content
This repository was archived by the owner on Mar 3, 2018. It is now read-only.

Commit a63fbf4

Browse files
author
Rolandas Barysas
committed
Add client_id to request urls
Resolves #10
1 parent e51377a commit a63fbf4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def fetch_followed_channels(self, username):
1818
try:
1919
self.followed_channels = []
2020

21-
self.f = urllib.urlopen("https://api.twitch.tv/kraken/users/{0}/follows/channels?direction=DESC&limit=100&offset=0&sortby=created_at".format(username))
21+
self.f = urllib.urlopen("https://api.twitch.tv/kraken/users/{0}/follows/channels?client_id=oe77z9pq798tln7ngil0exwr0mun4hj&direction=DESC&limit=100&offset=0&sortby=created_at".format(username))
2222
self.data = json.loads(self.f.read())
2323

2424
# Return 404 if user does not exist
@@ -31,7 +31,7 @@ def fetch_followed_channels(self, username):
3131
self.pages = (self.data['_total'] - 1) / 100
3232
for page in range(0, self.pages + 1):
3333
if page != 0:
34-
self.f = urllib.urlopen("https://api.twitch.tv/kraken/users/{0}/follows/channels?direction=DESC&limit=100&offset={1}&sortby=created_at".format(username, (page * 100)))
34+
self.f = urllib.urlopen("https://api.twitch.tv/kraken/users/{0}/follows/channels?client_id=oe77z9pq798tln7ngil0exwr0mun4hj&direction=DESC&limit=100&offset={1}&sortby=created_at".format(username, (page * 100)))
3535
self.data = json.loads(self.f.read())
3636

3737
for channel in self.data['follows']:
@@ -54,7 +54,7 @@ def fetch_live_streams(self, channels):
5454
self.offset = self.channels_count
5555
self.channels_offset = channels[(page * 75):self.offset]
5656

57-
self.f = urllib.urlopen("https://api.twitch.tv/kraken/streams?channel={0}".format(','.join(self.channels_offset)))
57+
self.f = urllib.urlopen("https://api.twitch.tv/kraken/streams?client_id=oe77z9pq798tln7ngil0exwr0mun4hj&channel={0}".format(','.join(self.channels_offset)))
5858
self.data = json.loads(self.f.read())
5959

6060
for stream in self.data['streams']:

0 commit comments

Comments
 (0)