diff --git a/scripts/findTreatedChannelWithMostSubscribers.py b/scripts/findTreatedChannelWithMostSubscribers.py index bd8f0e6..efd3bc9 100755 --- a/scripts/findTreatedChannelWithMostSubscribers.py +++ b/scripts/findTreatedChannelWithMostSubscribers.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -import os, requests, json +import os, requests channelIds = [channelId.replace('.zip', '') for channelId in next(os.walk('channels/'))[2]] maxResults = 50 @@ -11,8 +11,7 @@ mostSubscriberChannel = None for channelIds in channelIdsChunks: url = 'https://yt.lemnoslife.com/noKey/channels?part=statistics&id=' + ','.join(channelIds) - content = requests.get(url).text - data = json.loads(content) + data = requests.get(url).json() items = data['items'] for item in items: subscriberCount = int(item['statistics']['subscriberCount'])