Skip to main content

PlayOn facilities, primarily access to the download API. Includes a nice command line tool.

Project description

PlayOn facilities, primarily access to the download API. Includes a nice command line tool.

Latest release 20240201:

  • PlayOnCommand.cmd_dl: collapse dashes more reliably, restore the space squashing, make the downloads interruptable.
  • PlayOnCommand._list: sort each listing argument by recording id.

Function main(argv=None)

Playon command line mode; see the PlayOnCommand class below.

Class PlayOnAPI(cs.service_api.HTTPServiceAPI, cs.service_api.ServiceAPI, cs.resources.MultiOpenMixin, cs.context.ContextManagerMixin)

Access to the PlayOn API.

Class PlayOnCommand(cs.cmdutils.BaseCommand)

Playon command line implementation.

Command line usage:

Usage: playon subcommand [args...]

    Environment:
      PLAYON_USER               PlayOn login name, default from $EMAIL.
      PLAYON_PASSWORD           PlayOn password.
                                This is obtained from .netrc if omitted.
      PLAYON_FILENAME_FORMAT  Format string for downloaded filenames.
                                Default: {series_prefix}{series_episode_name}--{resolution}--{playon.ProviderID}--playon--{playon.ID}
      PLAYON_TAGS_DBURL         Location of state tags database.
                                Default: ~/var/playon.sqlite

    Recording specification:
      an int        The specific recording id.
      all           All known recordings.
      downloaded    Recordings already downloaded.
      expired       Recording which are no longer available.
      pending       Recordings not already downloaded.
      /regexp       Recordings whose Series or Name match the regexp,
                    case insensitive.

  Subcommands:
    account
      Report account state.
    api suburl
      GET suburl via the API, print result.
    cds suburl
      GET suburl via the content delivery API, print result.
      Example subpaths:
        content
        content/provider-name
    dl [-j jobs] [-n] [recordings...]
      Download the specified recordings, default "pending".
      -j jobs   Run this many downloads in parallel.
                The default is 2.
      -n        No download. List the specified recordings.
    downloaded recordings...
      Mark the specified recordings as downloaded and no longer pending.
    feature [feature_id]
      List features.
    help [-l] [subcommand-names...]
      Print the full help for the named subcommands,
      or for all subcommands if no names are specified.
      -l  Long help even if no subcommand-names provided.
    ls [-l] [recordings...]
      List available downloads.
      -l        Long listing: list tags below each entry.
      -o format Format string for each entry.
      Default format: {playon.ID} {playon.HumanSize} {resolution} {playon.Series} {playon.Name} {playon.ProviderID} {status:upper}
    poll ...
    q [-l] [recordings...]
      List queued recordings.
      -l        Long listing: list tags below each entry.
      -o format Format string for each entry.
      Default format: {playon.ID} {playon.Series} {playon.Name} {playon.ProviderID}
    queue [-l] [recordings...]
      List queued recordings.
      -l        Long listing: list tags below each entry.
      -o format Format string for each entry.
      Default format: {playon.ID} {playon.Series} {playon.Name} {playon.ProviderID}
    refresh [queue] [recordings]
      Update the db state from the PlayOn service.
    service [service_id]
      List services.
    shell
      Run a command prompt via cmd.Cmd using this command's subcommands.

Class PlayOnSQLTags(cs.sqltags.SQLTags, cs.tagset.BaseTagSets, cs.resources.MultiOpenMixin, cs.context.ContextManagerMixin, collections.abc.MutableMapping, collections.abc.Mapping, collections.abc.Collection, collections.abc.Sized, collections.abc.Iterable, collections.abc.Container, cs.deco.Promotable)

SQLTags subclass with PlayOn related methods.

Class Recording(cs.sqltags.SQLTagSet, cs.obj.SingletonMixin, cs.tagset.TagSet, builtins.dict, cs.dateutils.UNIXTimeMixin, cs.lex.FormatableMixin, cs.lex.FormatableFormatter, string.Formatter, cs.mappings.AttrableMappingMixin)

An SQLTagSet with knowledge about PlayOn recordings.

Release Log

Release 20240201:

  • PlayOnCommand.cmd_dl: collapse dashes more reliably, restore the space squashing, make the downloads interruptable.
  • PlayOnCommand._list: sort each listing argument by recording id.

Release 20230705: DEFAULT_FILENAME_FORMAT: replace naive playon.Name with series_episode_name which is the name with leading series/episode info removed, honour in "playon dl".

Release 20230703:

  • PlayOnAPI: features, feature, featured_image_url, service_image_url.
  • PlayOnCommand: new cmd_feature like cmd_service but for featured shows.
  • PlayOnAPI.suburl: infer _base_url from api_version if _base_url is None and api_version is provided.
  • Recording.is_downloaded: also check for a 'downloaded' tag, fallback for when the downloaded_path is empty.
  • PlayOnCommand.cmd_downloaded: add 'downloaded" tag to specified recordings.

Release 20230217:

  • Move some core stuff off into cs.service_api.HTTPServiceAPI.
  • Move core Recording.is_stale() method to TagSet.is_stale(), leave override method behind.
  • Persist login tokens in a db for reuse while still fresh.
  • "playon dl": allow interrupting downloads.
  • Cleaner handling of playon.Name having a leading SNNeNN prefix.

Release 20221228:

  • PlayOnAPI.suburl_data: progress reporting, raise on bad response, upgrade JSON error warning.
  • PlayOnAPI: use a common cookie jar across API calls.
  • PlayOnCommand: new "api" and "cds" API access subcommands.
  • PlayOnCommand._refresh_sqltags_data: bugfix "expired cache" logic.
  • PlayOnCommand: new "poll" subcommand reporting the API notifications response.

Release 20220311: Bugfix criteria for refreshing the PlayOn state.

Release 20211212: Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs.app.playon-20240201.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cs.app.playon-20240201-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file cs.app.playon-20240201.tar.gz.

File metadata

  • Download URL: cs.app.playon-20240201.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for cs.app.playon-20240201.tar.gz
Algorithm Hash digest
SHA256 2468d8f43b377cea8696562a7d7a168014dd591bf0780e20ea9f27c91e4b2e7c
MD5 d40ebe31650f3e3c5f0c0c2efb052d6c
BLAKE2b-256 fd6d2c9ca67767105f9c1c968bedf5ed6ad845b8e146c0fd32738e386dfad1ea

See more details on using hashes here.

File details

Details for the file cs.app.playon-20240201-py3-none-any.whl.

File metadata

File hashes

Hashes for cs.app.playon-20240201-py3-none-any.whl
Algorithm Hash digest
SHA256 c7e690f7b5f4e43188b4378b9df19c9b605502571fe18a9459ae7a11cbacbfac
MD5 16356423404faaaeda45b2b0f811a4af
BLAKE2b-256 2cf0250ac5c3de5d061a0c970dc5f9911b72b1e0846525e0a77bb06f5ab7eba4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page