mirror of
https://github.com/bellingcat/cisticola.git
synced 2026-06-13 05:48:33 +03:00
merged main
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user