direct.py 540 B

1234567891011121314151617
  1. #!/usr/bin/env python3
  2. from typing import Optional
  3. from praw.models import Submission
  4. from bdfr.site_authenticator import SiteAuthenticator
  5. from bdfr.resource import Resource
  6. from bdfr.site_downloaders.base_downloader import BaseDownloader
  7. class Direct(BaseDownloader):
  8. def __init__(self, post: Submission):
  9. super().__init__(post)
  10. def find_resources(self, authenticator: Optional[SiteAuthenticator] = None) -> list[Resource]:
  11. return [Resource(self.post, self.post.url, Resource.retry_download(self.post.url))]