1
0
Fork 0
mirror of synced 2024-06-02 10:24:39 +12:00
bulk-downloader-for-reddit/bdfr/site_downloaders/direct.py

19 lines
564 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
2021-02-25 23:40:08 +13:00
from typing import Optional
2021-02-11 12:10:40 +13:00
from praw.models import Submission
2021-04-12 19:58:32 +12:00
from bdfr.resource import Resource
2022-12-03 18:11:17 +13:00
from bdfr.site_authenticator import SiteAuthenticator
2021-04-12 19:58:32 +12:00
from bdfr.site_downloaders.base_downloader import BaseDownloader
2021-02-07 14:33:19 +13:00
class Direct(BaseDownloader):
2021-02-15 18:12:27 +13:00
def __init__(self, post: Submission):
super().__init__(post)
2021-02-26 21:57:05 +13:00
def find_resources(self, authenticator: Optional[SiteAuthenticator] = None) -> list[Resource]:
return [Resource(self.post, self.post.url, Resource.retry_download(self.post.url))]