upsies.trackers.bhd.tracker

Concrete TrackerBase subclass for BHD

Classes

class upsies.trackers.bhd.tracker.BhdTracker(options=None)[source]

Bases: TrackerBase

setup_howto_template = '{howto.introduction}\n\n{howto.next_section}. Announce Passkey\n\n   {howto.current_section}.1 On the website, go to My Settings -> Security -> Passkey\n       and copy your personal PASSKEY.\n   {howto.current_section}.2 $ upsies set trackers.{tracker.name}.announce_passkey PASSKEY\n\n{howto.next_section}. API Key\n\n   {howto.current_section}.1 On the website, go to My Settings -> Security -> API Key\n       and copy your personal API_KEY.\n   {howto.current_section}.2 $ upsies set trackers.{tracker.name}.apikey API_KEY\n\n{howto.screenshots}\n\n{howto.autoseed}\n\n{howto.reuse_torrents}\n\n{howto.upload}\n   $ {executable} submit {tracker.name} /path/to/content --draft\n'

Step-by-step guide that explains how to make your first upload

Note

This MUST be a class attribute and not a property.

The following placeholders can be used in f-string format:

  • howto - Howto instance

  • tracker - TrackerBase subclass

  • executable - Name of the executable that runs the application

TrackerJobs

alias of BhdTrackerJobs

TrackerConfig

alias of BhdTrackerConfig

cli_arguments = {'submit': {('--anonymous', '--an'): {'help': 'Hide your username for this submission\nValid BOOL values: true/false, yes/no, 1/0, on/off, aye/nay', 'metavar': 'BOOL', 'type': <function bool_or_none>}, ('--custom-edition', '--ce'): {'default': '', 'help': 'Non-standard edition, e.g. "Final Cut"'}, ('--draft', '--dr'): {'action': 'store_true', 'default': None, 'help': 'Upload as draft'}, ('--imdb', '--im'): {'help': 'IMDb ID or URL', 'type': <function webdb_id.<locals>.webdb_id>}, ('--nfo',): {'help': 'Path to NFO file (supersedes any *.nfo file found in the release directory)'}, ('--only-description', '--od'): {'action': 'store_true', 'group': 'generate-metadata', 'help': 'Only generate description (do not submit)'}, ('--only-title', '--ot'): {'action': 'store_true', 'group': 'generate-metadata', 'help': 'Only generate title (do not submit)'}, ('--personal-rip', '--pr'): {'action': 'store_true', 'help': 'Tag submission as your own encode'}, ('--screenshots', '--ss'): {'action': 'extend', 'help': 'Path(s) to existing screenshot file(s)\nDirectories are searched recursively.\nMore screenshots are created if necessary.', 'metavar': 'SCREENSHOT', 'nargs': '+', 'type': <function files_with_extension.<locals>.files_with_extension>}, ('--screenshots-count', '--ssc'): {'help': 'How many screenshots to make (min=3, max=10)', 'type': functools.partial(<function integer>, min=3, max=10)}, ('--special', '--sp'): {'action': 'store_true', 'help': 'Tag as special episode, e.g. Christmas special (ignored for movie uploads)'}, ('--tmdb', '--tm'): {'help': 'TMDb ID or URL', 'type': <function webdb_id.<locals>.webdb_id>}}}

CLI argument definitions (see CommandBase.cli_arguments)

rules = (<class 'upsies.trackers.bhd.rules.BhdBannedGroup'>, <class 'upsies.trackers.bhd.rules.BhdHdOnly'>)

Sequence of TrackerRuleBase subclasses or None

For convenience, this may also be a ModuleType that provides TrackerRuleBase subclasses.

async confirm_logged_in()[source]

Check if we are logged in by doing a website request

This method is called by login() to make sure _login() succeeded. It is also called by still_logged_in(), which is used check if a stored user session is still working or if a new session must be started (e.g. because the cookie expired).

Raises:

errors.RequestError – if we are not logged in

async get_announce_url()[source]

Get announce URL from options or tracker website

Warning

You should expect that login() was called first when implementing this method and raise RuntimeError if is_logged_in is False.

Raises:

errors.RequestError – on any kind of failure

get_upload_url()[source]

Return URL for torrent uploads (includes API key)

Raises:

RequestError – if apikey option is not set

async upload(tracker_jobs)[source]

Upload torrent and other metadata from jobs

Parameters:

tracker_jobs (TrackerJobsBase) – TrackerJobs instance

static calculate_piece_size(bytes)[source]