2023-01-04 02:41:07 +01:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
2023-07-28 11:40:07 +02:00
|
|
|
import os, requests
|
2023-01-04 02:41:07 +01:00
|
|
|
|
2023-02-26 15:12:06 +01:00
|
|
|
channelIds = [channelId.replace('.zip', '') for channelId in next(os.walk('channels/'))[2]]
|
2023-01-04 02:41:07 +01:00
|
|
|
maxResults = 50
|
|
|
|
|
|
|
|
channelIdsChunks = [channelIds[i : i + maxResults] for i in range(0, len(channelIds), maxResults)]
|
|
|
|
mostSubscriberCount = 0
|
|
|
|
mostSubscriberChannel = None
|
|
|
|
|
|
|
|
for channelIds in channelIdsChunks:
|
|
|
|
url = 'https://yt.lemnoslife.com/noKey/channels?part=statistics&id=' + ','.join(channelIds)
|
2023-07-28 11:40:07 +02:00
|
|
|
data = requests.get(url).json()
|
2023-01-04 02:41:07 +01:00
|
|
|
items = data['items']
|
|
|
|
for item in items:
|
|
|
|
subscriberCount = int(item['statistics']['subscriberCount'])
|
|
|
|
if mostSubscriberCount < subscriberCount:
|
|
|
|
mostSubscriberCount = subscriberCount
|
|
|
|
mostSubscriberChannel = item['id']
|
|
|
|
|
|
|
|
print(mostSubscriberChannel, mostSubscriberCount)
|