From b60bb221126c714d659dc5cb21ed8815f74d5a28 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 28 Jul 2023 11:40:07 +0200 Subject: [PATCH] Simplify `scripts/findTreatedChannelWithMostSubscribers.py` --- scripts/findTreatedChannelWithMostSubscribers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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'])