YouTube link information plugin for Sopel.
Releases are hosted on PyPI, so after installing Sopel, all you need is pip
:
$ pip install sopel-youtube
(Make sure you use the "correct" pip
, i.e. the one corresponding to the Python
environment where you have Sopel installed.)
You can simply pip uninstall sopel-modules.youtube
prior to installing this
package; no extra steps should be needed. sopel-youtube
inherits the
configuration section originally defined and used by the older versions.
If you want to help develop or test the plugin, you'll need to install from source. Clone the repo first, then:
$ pip install -e .
To run tests, make sure you have the development dependencies as well:
$ pip install -r dev-requirements.txt
Run the test suite from the repo root directory:
$ pytest -v .
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 (see below),
or the api_key
field of the config file's [youtube]
section.
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
.
If video "watch" links contain a comment ID, the plugin will only show info
about the comment by default. If you also want video info posted in this
situation, set comment_watch
to True
.
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)likes
(count)uploader
(channel name)views
(view count)