Skip to content

Commit

Permalink
Fix Community Comment Scanning
Browse files Browse the repository at this point in the history
- YouTube updated the web page layout source code at some point, so this fixes the references to the location of the posts

Addresses #1082
  • Loading branch information
ThioJoe committed Dec 24, 2023
1 parent 6ec0596 commit b11d65c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ SpamPurgeConfig.ini
# Ignore Resources Folders
spam_lists/
SpamPurge_Resources/
.DS_Store
5 changes: 3 additions & 2 deletions Scripts/community_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ def fetch_recent_community_posts(channel_id):

html = response.text
data = json.loads(regex_search(html, YT_INITIAL_DATA_RE, default=''))
section = next(search_dict(data, 'itemSectionRenderer'), None)
rawPosts = list(search_dict(section, 'backstagePostRenderer'))
rendererSubsection = next(search_dict(data, 'twoColumnBrowseResultsRenderer'), None)
itemSection = next(search_dict(rendererSubsection, 'itemSectionRenderer'), None)
rawPosts = list(search_dict(itemSection, 'backstagePostRenderer'))

recentPostsListofDicts = [] # Use list to keep in order - Puts post ID and sample of text into dictionary keypair, strips newlines
# Gets the Post IDs and sample of post text
Expand Down
2 changes: 1 addition & 1 deletion YTSpammerPurge.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
### IMPORTANT: I OFFER NO WARRANTY OR GUARANTEE FOR THIS SCRIPT. USE AT YOUR OWN RISK.
### I tested it on my own and implemented some failsafes as best as I could,
### but there could always be some kind of bug. You should inspect the code yourself.
version = "2.17.0"
version = "2.17.1"
configVersion = 32
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
print("Importing Script Modules...")
Expand Down

0 comments on commit b11d65c

Please sign in to comment.