merged main

This commit is contained in:
Tristan Lee
2022-04-01 02:05:25 -05:00
15 changed files with 35 additions and 7 deletions

View File

@@ -275,6 +275,7 @@ class Scraper:
raise NotImplementedError
@logger.catch
def get_posts(self, channel: Channel, since: ScraperResult = None, archive_media: bool = True) -> Generator[ScraperResult, None, None]:
"""Scrape all posts from the specified Channel.
@@ -341,7 +342,6 @@ class ScraperController:
return self.scrape_channel_info(channels)
@logger.catch(reraise = True)
def scrape_channels(self, channels: List[Channel], archive_media: bool = True):
"""Scrape all posts for all specified channels.
@@ -388,6 +388,9 @@ class ScraperController:
session.add(post)
added += 1
if added > 100:
break
session.commit()
logger.info(
f"{scraper} found {added} new posts from {channel}")