As videos are large, often the videos are hosted on a remote machine that is different to the one you will manipulate metadata, and commit to git on.
So, these examples will have commands being executed on 2 machines, the “uploader machine” (e.g. apu for DebConf) and “your machine”. But you can, of course, do this all on a single machine.
The once-off setup below applies to the uploader machine.
YouTube authentication: credential creation¶
You can skip this if someone gives you a
- Enable the YouTube Data v3 API in the “Library”.
- Create an OAuth 2.0 client ID in the “Credentials”.
- Download the Client ID JSON, and save it as
This uploader requires a few Python libraries (see
You can either install them from Debian, or create a virtualenv to
Create a new Python virtualenv:
python3 -m venv ve ve/bin/python -m ensurepip -U ve/bin/python -m pip install wheel
Install the required packages in the virtualenv:
ve/bin/python -m pip install -r requirements.txt
Activate the virtualenv before using these tools, every time:
Import videos from a conference¶
Upload the videos to the meetings-archive.
Describe them in archive-meta.
A new metadata file should be created with your new playlist. Check the contents, edit archive-meta if necessary, and repeat until satisfied with the data.
Check and update the
defaults, applied to every upload.
Optional: Create a playlist in YouTube, and record this in the
Copy this YouTube metadata file to the uploader machine with the meetings-archive available locally.
Run the upload script, on the uploader machine, in the base directory for the conference videos, recording uploaded video IDs to a log.
The first time you do this, you’ll have to authorize it.
cd /srv/video/video.debian.net/2019/example/ ~/youtube/tools/upload_youtube.py --wait \ ~/youtube/metadata/2019/example.yml ~/upload.log
upload.logback to your machine.
Merge the video IDs from it into the metadata file:
tools/merge-uploads.py metadata/2019/example.yml upload.log
--waitwill cause the uploader to wait and retry, until the entire playlist is uploaded, even if YouTube rate-limits are reached.
If you aren’t using
--wait, or have another failure, and need to continue a partial upload:
- Ensure the uploaded video IDs have been merged into the metadata (from the above steps).
- Update the metadata on the uploader machine.
- Run the upload script again. It will upload videos without