From ca00b480b13f4bad7a06317a9a9f0a95e73091fb Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Tue, 4 Jan 2022 01:15:08 +0000 Subject: [PATCH] Fix AssertionError on quoted comments Fixes #340 --- snscrape/modules/vkontakte.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snscrape/modules/vkontakte.py b/snscrape/modules/vkontakte.py index 99cfb17..13aa4e5 100644 --- a/snscrape/modules/vkontakte.py +++ b/snscrape/modules/vkontakte.py @@ -154,7 +154,7 @@ class VKontakteUserScraper(snscrape.base.Scraper): _logger.warning(f'Skipping post without link: {str(post)[:200]!r}') return url = urllib.parse.urljoin(self._baseUrl, postLink['href']) - assert (url.startswith('https://vk.com/wall') or (isCopy and (url.startswith('https://vk.com/video') or url.startswith('https://vk.com/photo')))) and '_' in url and url[-1] != '_' and url.rsplit('_', 1)[1].strip('0123456789') == '' + assert (url.startswith('https://vk.com/wall') or (isCopy and (url.startswith('https://vk.com/video') or url.startswith('https://vk.com/photo')))) and '_' in url and url[-1] != '_' and url.rsplit('_', 1)[1].strip('0123456789') in ('', '?reply=') if not isCopy: dateSpan = post.find('div', class_ = 'post_date').find('span', class_ = 'rel_date') else: