Fix Community Comment Scanning

- YouTube updated the web page layout source code at some point, so this fixes the references to the location of the posts

Addresses #1082
This commit is contained in:
ThioJoe
2023-12-23 20:34:48 -05:00
parent 6ec0596fff
commit b11d65c982
3 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@@ -135,3 +135,4 @@ SpamPurgeConfig.ini
# Ignore Resources Folders
spam_lists/
SpamPurge_Resources/
.DS_Store

View File

@@ -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

View File

@@ -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...")