From be363cf9bd3136bf8fdc5740825a5cfaf4f349a4 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Thu, 19 Dec 2019 23:06:27 +0000 Subject: [PATCH] Fix variable naming --- comments.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/comments.py b/comments.py index b444eea..da90c45 100644 --- a/comments.py +++ b/comments.py @@ -83,9 +83,9 @@ class Comments(qwarc.Item): if not response or response.status != 200: self.logger.error('Could not fetch video page') return - contents = await response.read() + content = await response.read() - sessionToken = qwarc.utils.str_get_between(contents, b'"XSRF_TOKEN":"', b'"') + sessionToken = qwarc.utils.str_get_between(content, b'"XSRF_TOKEN":"', b'"') if not sessionToken: self.logger.error('Could not find session token') return @@ -94,15 +94,15 @@ class Comments(qwarc.Item): return sessionToken = sessionToken.decode('ascii') - sectionIdentifierPos = contents.find(b'"comment-item-section"') + sectionIdentifierPos = content.find(b'"comment-item-section"') if sectionIdentifierPos < 0: self.logger.error('Could not find comment section identifier') return - continuationStartPos = contents.rfind(b'"continuation":', 0, sectionIdentifierPos) + continuationStartPos = content.rfind(b'"continuation":', 0, sectionIdentifierPos) if continuationStartPos < 0: self.logger.error('Could not find continuation start position') return - section = contents[continuationStartPos:sectionIdentifierPos] + section = content[continuationStartPos:sectionIdentifierPos] continuationToken = qwarc.utils.str_get_between(section, b'"continuation":"', b'"') if continuationToken.lstrip(b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-') not in (b'', b'=', b'=='): self.logger.error('Unexpected continuation token value: {continuationToken!r}')