Catch errors in channel info

This commit is contained in:
Logan Williams
2022-04-13 10:10:29 +02:00
parent d5f6ce485b
commit a0dbe7d92b
11 changed files with 11 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ class BitchuteScraper(Scraper):
if channel.platform == "Bitchute" and self.get_username_from_url(channel.url) is not None:
return True
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
base_url = channel.url

View File

@@ -89,6 +89,7 @@ class GabScraper(Scraper):
if channel.platform == "Gab" and self.get_username_from_url(channel.url) is not None:
return True
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
client = Client(

View File

@@ -72,6 +72,7 @@ class GettrScraper(Scraper):
key = urlparse(url).path.split('/')[-2] + ext
return key
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
client = PublicClient()
username = self.get_username_from_url(channel.url)

View File

@@ -91,6 +91,7 @@ class InstagramScraper(Scraper):
if channel.platform == "Instagram" and self.get_username_from_url(channel.url) is not None:
return True
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
username = self.get_username_from_url(channel.url)

View File

@@ -105,6 +105,7 @@ class OdyseeScraper(Scraper):
return f'{key}.{ext}'
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
username = self.get_username_from_url(channel.url)

View File

@@ -69,6 +69,7 @@ class RumbleScraper(Scraper):
if channel.platform == "Rumble" and channel.url is not None:
return True
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
profile = get_channel_profile(url = channel.url)

View File

@@ -55,6 +55,7 @@ class TelegramSnscrapeScraper(Scraper):
media_archived=datetime.now(timezone.utc) if archive_media else None
)
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
scr = snscrape.modules.telegram.TelegramChannelScraper(

View File

@@ -149,6 +149,7 @@ class TelegramTelethonScraper(Scraper):
archived_urls=archived_urls,
media_archived=datetime.now(timezone.utc) if archive_media else None)
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
username = channel.screenname
if username is None:

View File

@@ -97,6 +97,7 @@ class TwitterScraper(Scraper):
key = parsed_url.path.split('/')[-1] + ext
return key
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
scraper = TwitterUserScraper(channel.screenname)

View File

@@ -103,6 +103,7 @@ class VkontakteScraper(Scraper):
return key
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
username = self.get_username_from_url(channel.url)

View File

@@ -138,6 +138,7 @@ class YoutubeScraper(Scraper):
result.media_archived = datetime.now(timezone.utc)
return result
@logger.catch
def get_profile(self, channel: Channel) -> RawChannelInfo:
ydl_opts = {