Simplify scripts/findTreatedChannelWithMostSubscribers.py
This commit is contained in:
parent
654769b80b
commit
b60bb22112
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import os, requests, json
|
import os, requests
|
||||||
|
|
||||||
channelIds = [channelId.replace('.zip', '') for channelId in next(os.walk('channels/'))[2]]
|
channelIds = [channelId.replace('.zip', '') for channelId in next(os.walk('channels/'))[2]]
|
||||||
maxResults = 50
|
maxResults = 50
|
||||||
@ -11,8 +11,7 @@ mostSubscriberChannel = None
|
|||||||
|
|
||||||
for channelIds in channelIdsChunks:
|
for channelIds in channelIdsChunks:
|
||||||
url = 'https://yt.lemnoslife.com/noKey/channels?part=statistics&id=' + ','.join(channelIds)
|
url = 'https://yt.lemnoslife.com/noKey/channels?part=statistics&id=' + ','.join(channelIds)
|
||||||
content = requests.get(url).text
|
data = requests.get(url).json()
|
||||||
data = json.loads(content)
|
|
||||||
items = data['items']
|
items = data['items']
|
||||||
for item in items:
|
for item in items:
|
||||||
subscriberCount = int(item['statistics']['subscriberCount'])
|
subscriberCount = int(item['statistics']['subscriberCount'])
|
||||||
|
Loading…
Reference in New Issue
Block a user