Compare commits
No commits in common. "b60bb221126c714d659dc5cb21ed8815f74d5a28" and "3ca58b24665867bc63bf6f477a03219ae4c15514" have entirely different histories.
b60bb22112
...
3ca58b2466
@ -9,7 +9,7 @@ path = 'channels/'
|
||||
os.chdir(path)
|
||||
|
||||
def getTimestampFromDateString(dateString):
|
||||
return int(time.mktime(datetime.datetime.strptime(dateString, '%Y-%m-%dT%H:%M:%SZ').timetuple()))
|
||||
return int(time.mktime(datetime.datetime.strptime(dateString, "%Y-%m-%dT%H:%M:%SZ").timetuple()))
|
||||
|
||||
for channelId in list(os.walk('.'))[1]:
|
||||
channelId = channelId[2:]
|
||||
@ -26,7 +26,8 @@ for channelId in list(os.walk('.'))[1]:
|
||||
snippet = snippet['topLevelComment']['snippet']
|
||||
latestTreatedCommentDate = snippet['publishedAt']
|
||||
url = f'https://yt.lemnoslife.com/noKey/channels?part=snippet&id={channelId}'
|
||||
data = requests.get(url).json()
|
||||
content = requests.get(url).text
|
||||
data = json.loads(content)
|
||||
channelCreationDate = data['items'][0]['snippet']['publishedAt']
|
||||
#print(channelCreationDate)
|
||||
# Timing percentage not taking into account the not uniform in time distribution of comments. Note that in the case of the last request is to list replies to a comment, the percentage might goes a bit backward, as replies are posted after the initial comment.
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os, requests
|
||||
import os, requests, json
|
||||
|
||||
channelIds = [channelId.replace('.zip', '') for channelId in next(os.walk('channels/'))[2]]
|
||||
maxResults = 50
|
||||
@ -11,7 +11,8 @@ mostSubscriberChannel = None
|
||||
|
||||
for channelIds in channelIdsChunks:
|
||||
url = 'https://yt.lemnoslife.com/noKey/channels?part=statistics&id=' + ','.join(channelIds)
|
||||
data = requests.get(url).json()
|
||||
content = requests.get(url).text
|
||||
data = json.loads(content)
|
||||
items = data['items']
|
||||
for item in items:
|
||||
subscriberCount = int(item['statistics']['subscriberCount'])
|
||||
|
Loading…
Reference in New Issue
Block a user