From 3f8935ee4d8f556071c5a22b6d1c53f39c9fba85 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Sat, 17 Oct 2020 02:20:40 +0000 Subject: [PATCH] Fix crash on video reposts --- 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 64667e5..26eab3e 100644 --- a/snscrape/modules/vkontakte.py +++ b/snscrape/modules/vkontakte.py @@ -94,7 +94,7 @@ class VKontakteUserScraper(snscrape.base.Scraper): def _post_div_to_item(self, post, isCopy = False): url = urllib.parse.urljoin(self._baseUrl, post.find('a', class_ = 'post_link' if not isCopy else 'published_by_date')['href']) - assert url.startswith('https://vk.com/wall') 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')) and '_' in url and url[-1] != '_' and url.rsplit('_', 1)[1].strip('0123456789') == '' if not isCopy: dateSpan = post.find('div', class_ = 'post_date').find('span', class_ = 'rel_date') else: