Youtubetobibtex
Youtubetobibtex is a small library to export information from a YouTube video in a bibtex format.
The bibtex looks like :
@online{video:tomscott2019,
title = {Why Electronic Voting Is Still A Bad Idea},
date = {2019},
organization = {YouTube},
author = {Tom Scott},
url = {https://youtube.com/watch?v=LkH2r-sNjQs},
}
(example with the video https://www.youtube.com/watch\?v=v=LkH2r-sNjQs).
Youtubetobibtex is available online at : https://pypi.org/project/youtubetobibtex/
Usage
The documentation can be found at : https://youtubetobibtex.readthedocs.io/en/latest/
Class usage
The main part of the code is the YoutubetobibtexClient class. It implements methods to easily retrieve the bibtex
In [1]: from youtubetobibtex import YoutubetobibtexClient
In [2]: client = YoutubetobibtexClient("secret")
In [3]: client.check() # check if the client is correctly connected to google api
Out[3]: True
In [4]: video_id = client.get_video_id("https://www.youtube.com/watch\?v=v=LkH2r-sNjQs") # get id from url. several schemes of url are supported
In [5]: video_id
Out[5]: 'LkH2r-sNjQs'
In [6]: client.get_bibtex(video_id) # get bibtex
Out[6]: '\n@online{video:tomscott2019,\n title = {Why Electronic Voting Is Still A Bad Idea},\n date = {2019},\n organization = {YouTube},\n author = {Tom Scott},\n url = {https://youtube.com/watch?v=LkH2r-sNjQs},\n}\n
The secret refers at the API key.
Cli usage
There is a command line interface shipped with youtubetobibtex. It can be used as follows :
youtubetobibtex https://youtube.com/watch?v=LkH2r-sNjQs secret
You can also use the python script :
python3 youtubetobibtex/cli.py https://youtube.com/watch?v=LkH2r-sNjQs secret
TODO
- Allow to enable more information in the bibtex, using options in the class
- Allow the command line interface to get the api key form file
- Properly close the socket if the api key is wrong
Run the tests
Command to run the tests :
python3 setup.py
or with coverage
coverage run --source=youtubetobibtex/ setup.py test
Metadata
Release files for youtubetobibtex 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| youtubetobibtex-0.1.3.tar.gz | 16.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| youtubetobibtex-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.6 kB
Release files / youtubetobibtex-0.1.3.tar.gz
| Download URL | youtubetobibtex-0.1.3.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3249e571d1d9d517404e2b18287dad487d320da66d33969c2f5cdb24f0fff020
|
|
BLAKE2b-256 checksum How to use checksums |
b058b6e090a513d880dbfb88c67603dc076457ad4d69cec50fa45d9412ffb97c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Release files / youtubetobibtex-0.1.3-py3-none-any.whl
| Download URL | youtubetobibtex-0.1.3-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39e46cea92c4b69a8c3cd8dd2ed37e0a836ee39c2125b87a7232d0dcb49963e4
|
|
BLAKE2b-256 checksum How to use checksums |
459deb7a0f7fdb936c0c3b9b62ab52578d189dd4e0e18a4b1d701ad628003157
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Security for youtubetobibtex 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.