added methods for extracting channel profile metadata, and tests

This commit is contained in:
Tristan Lee
2022-03-28 21:11:34 -05:00
parent ea40ea2640
commit 67d1abf024
14 changed files with 120 additions and 9 deletions

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import GabScraper
@@ -14,3 +16,10 @@ def test_scrape_gab_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['gab'])]
controller.register_scraper(scraper = GabScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_gab_profile(channel_kwargs):
scraper = GabScraper()
channel = Channel(**channel_kwargs['gab'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import GettrScraper
@@ -14,3 +16,10 @@ def test_scrape_gettr_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['gettr'])]
controller.register_scraper(scraper = GettrScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_gettr_profile(channel_kwargs):
scraper = GettrScraper()
channel = Channel(**channel_kwargs['gettr'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import InstagramScraper
@@ -14,3 +16,10 @@ def test_scrape_instagram_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['instagram'])]
controller.register_scraper(scraper = InstagramScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_instagram_profile(channel_kwargs):
scraper = InstagramScraper()
channel = Channel(**channel_kwargs['instagram'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import OdyseeScraper
@@ -14,3 +16,10 @@ def test_scrape_odysee_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['odysee'])]
controller.register_scraper(scraper = OdyseeScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_odysee_profile(channel_kwargs):
scraper = OdyseeScraper()
channel = Channel(**channel_kwargs['odysee'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import RumbleScraper
@@ -14,3 +16,10 @@ def test_scrape_rumble_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['rumble'])]
controller.register_scraper(scraper = RumbleScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_rumble_profile(channel_kwargs):
scraper = RumbleScraper()
channel = Channel(**channel_kwargs['rumble'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import TelegramSnscrapeScraper
@@ -14,3 +16,10 @@ def test_scrape_telegram_snscrape_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['telegram'])]
controller.register_scraper(scraper = TelegramSnscrapeScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_telegram_snscrape_profile(channel_kwargs):
scraper = TelegramSnscrapeScraper()
channel = Channel(**channel_kwargs['telegram'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import TelegramTelethonScraper
@@ -14,3 +16,10 @@ def test_scrape_telegram_telethon_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['telegram'])]
controller.register_scraper(scraper = TelegramTelethonScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_telegram_telethon_profile(channel_kwargs):
scraper = TelegramTelethonScraper()
channel = Channel(**channel_kwargs['telegram'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import TwitterScraper
@@ -14,3 +16,10 @@ def test_scrape_twitter_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['twitter'])]
controller.register_scraper(scraper = TwitterScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_twitter_profile(channel_kwargs):
scraper = TwitterScraper()
channel = Channel(**channel_kwargs['twitter'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import VkontakteScraper
@@ -14,3 +16,10 @@ def test_scrape_vkontakte_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['vkontakte'])]
controller.register_scraper(scraper = VkontakteScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_vkontakte_profile(channel_kwargs):
scraper = VkontakteScraper()
channel = Channel(**channel_kwargs['vkontakte'])
scraper.get_profile(channel=channel)

View File

@@ -1,3 +1,5 @@
import pytest
from cisticola.base import Channel
from cisticola.scraper import YoutubeScraper
@@ -14,3 +16,10 @@ def test_scrape_youtube_channel(controller, channel_kwargs):
channels = [Channel(**channel_kwargs['youtube'])]
controller.register_scraper(scraper = YoutubeScraper())
controller.scrape_channels(channels = channels, archive_media = True)
@pytest.mark.profile
def test_scrape_youtube_profile(channel_kwargs):
scraper = YoutubeScraper()
channel = Channel(**channel_kwargs['youtube'])
scraper.get_profile(channel=channel)