Skip to main content

YouTube plugin for Sopel

Project description

sopel-youtube

YouTube info plugin for Sopel

Installing

If possible, use pip to install this plugin. Below are example commands; you might need to add sudo and/or call a different pip (e.g. pip3) depending on your system and environment. Do not use setup.py install; Sopel won't be able to load the plugin correctly.

Published release

pip install sopel_modules.youtube

From source

# Clone the repo, then run this in /path/to/sopel-youtube
pip install .

Getting your API key

Go to the Google Developers Console and create an application. When it's created, go to the APIs section, select the YouTube Data API and enable it. Then go to the Credentials section, select "Add credentials", pick "API key", and then "Server key". You can enter a name for it and limit the IPs it can be used from, but you don't have to. Copy the value it gives you into the prompt in the config wizard, or the api_key value of the config in the [youtube] section.

Config settings

sopel-youtube supports Sopel's interactive configuration wizard:

sopel-plugins configure youtube

The api_key option is self-explanatory (see above).

If video "watch" links contain a playlist ID, the plugin will show the playlist info as well as the video info by default. To disable this, set playlist_watch to False.

For videos, by default, only the video length, uploader (channel name), view count, and upload date are shown. The included items, and the order in which they appear, depend on the info_items setting, which is a list of keywords. Unrecognized keywords are simply ignored. Supported info_items are:

  • comments (comment count)
  • date (upload time/date)
  • length (duration)
  • uploader (channel name)
  • views (view count)
  • votes_color or votes (likes/dislikes, with or without IRC formatting)

Changes between 0.4.1 and 0.4.1

  • Improve error handling (#44)

Changes between 0.4.0 and 0.4.1

  • Handle "shorts" links (#36)
  • Be more careful about auto-playlists (#38)

Changes between 0.3.2 and 0.4.0

  • Enhance live stream support (#28)
  • Add playlist handling (#29, #33)
  • Protect against bidirectional text (#31)

Changes between 0.3.1 and 0.3.2

  • Clean up some problematic imports (#25)
  • Request only the necessary data fields from YouTube API (#27)

Changes between 0.3.0 and 0.3.1

  • Override handling of rare API errors reported to output the key (#23)

Changes between 0.2.1 and 0.3.0

  • Allow configuring what video details to include (#18)
  • Remove outdated, ugly colors on "[YouTube]" output tag (#21)
  • Minor cleanup (regex patterns, package metadata)

Changes between 0.2.0 and 0.2.1

  • Handle API sending wrongly formatted timestamps (#20)

Changes between 0.1.3 and 0.2.0

  • Update for Sopel 7 (#15)

Changes between 0.1.2 and 0.1.3

  • Add retry mechanic to API fetching (#11)
  • Fix exception traceback sometimes thrown on reconnect (#14)
  • Update ancient, deprecated usage of Sopel's memory API (#16)

Changes between 0.1.1 and 0.1.2

  • Fix error when video comments are disabled
  • Improve duration parser
  • Restrict google-api-python-client to compatible version range
  • Fix version-number import issue during installation

Changes between 0.1.0 and 0.1.1

  • Output is colorized
  • Fix configuration wizard
  • pip installation works regardless of pip version

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

sopel_modules.youtube-0.4.2.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

sopel_modules.youtube-0.4.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file sopel_modules.youtube-0.4.2.tar.gz.

File metadata

  • Download URL: sopel_modules.youtube-0.4.2.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for sopel_modules.youtube-0.4.2.tar.gz
Algorithm Hash digest
SHA256 f46734d52f71ed14246f547abbf89c8bd06ab0cc9fe7f0220ef2e80205620e0c
MD5 4b876a1d6b22e55cd57d29849393c271
BLAKE2b-256 a22a946bde31fb3af7ed835ee639f0aa11f40a47d4fe0b5498503b28bdba1d82

See more details on using hashes here.

Provenance

File details

Details for the file sopel_modules.youtube-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: sopel_modules.youtube-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for sopel_modules.youtube-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e331dee8383a0051c9fc0ec15f9ca5eae7ee192de47281a9a7be7984d9f8bc75
MD5 c65f1a052d6d9517ef83f247f4f04a71
BLAKE2b-256 b50810dbfe4a03e9222b77f4a49c96c6b1cf17c77061eb9eceb3c9429edc8b3c

See more details on using hashes here.

Provenance

Supported by

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