Created
June 13, 2025 19:48
-
-
Save exurd/da8e1370a71027b9fe8e4f118e4c584e to your computer and use it in GitHub Desktop.
Jupyter notebook for tubeup, a multi-VOD service to Archive.org uploader (https://github.com/bibanon/tubeup)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "87FkbuIw7qrk" | |
| }, | |
| "source": [ | |
| "# Install requirements and [tubeup](https://pypi.org/project/tubeup/)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "id": "-keLGxUs6Xhc" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "!sudo add-apt-repository universe -y\n", | |
| "!sudo apt-get install ffmpeg pipx git fontconfig python3.11-venv\n", | |
| "!pipx ensurepath" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "2Xi8N0_Gi2JY", | |
| "outputId": "c42ce2fe-d0be-4a4d-9f63-3c355da9a92e" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "!pipx install git+https://github.com/bibanon/tubeup.git" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "4RDJCcyO2Fx2" | |
| }, | |
| "source": [ | |
| "# Configure [internetarchive](https://pypi.org/project/internetarchive/) package" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "cellView": "form", | |
| "id": "wH2TN84I71FO" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "#@title Sign into IA\n", | |
| "#@markdown You will need to configure the Internet Archive package to upload any files.\n", | |
| "#@markdown <br> *No code in this notebook has been modified. If in doubt, verify with the source code in the links above.*\n", | |
| "\n", | |
| "!/root/.local/pipx/venvs/tubeup/bin/ia configure" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "7tbdcKHt8DE5" | |
| }, | |
| "source": [ | |
| "# Downloading and archiving videos\n", | |
| "Now you can download and archive videos. The downloader ([yt-dlp](https://github.com/yt-dlp/yt-dlp)) supports [these sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).\n", | |
| "\n", | |
| "Be mindful of what you upload and how frequently you do it. Read the information on uploading digital files to the IA [here](https://help.archive.org/help/category/archive-org/uploading/). If you are going to mass upload channels or videos, message the IA admins in advance.\n", | |
| "\n", | |
| "*From tubeup's readme.md:*\n", | |
| "> **Dumping entire channels into Community Video is abusive and may get your account locked.** _Talk to the Internet Archive admins first before doing large uploads; it's better to ask for guidence or help first than run afoul of the rules._\n", | |
| "\n", | |
| "Tip: Keep this tab pinned and active to have high network speeds." | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "cellView": "form", | |
| "id": "w80VpzGX8HPQ" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "#@markdown Enter the URL for the content you want to archive:\n", | |
| "url=\"\" #@param {type:\"string\", placeholder:\"enter url here\"}\n", | |
| "\n", | |
| "!/root/.local/bin/tubeup \"$url\"\n", | |
| "# $comments" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "bTULvn3KMaLS" | |
| }, | |
| "source": [ | |
| "# Advanced" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "cellView": "form", | |
| "id": "CMrpL_GwNG6-" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "#@markdown Use this cell to download content that requires cookies. Upload the cookie file to the runtime via the files tab, then specify the location of the file.\n", | |
| "cookies_file=\"\" #@param {type:\"string\", placeholder:\"location of cookie file\"}\n", | |
| "url=\"\" #@param {type:\"string\", placeholder:\"enter url here\"}\n", | |
| "\n", | |
| "!/root/.local/bin/tubeup --cookies \"$cookies_file\" \"$url\"\n", | |
| "# $comments" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "cellView": "form", | |
| "id": "A4jOEM0bguFb" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "#@title List files in .tubeup/downloads folder\n", | |
| "%cd /root/.tubeup/downloads\n", | |
| "!ls -1a" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "cellView": "form", | |
| "id": "AU8aIT79fOw6" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "#@title Clean up .tubeup/downloads folder (CANNOT BE UNDONE)\n", | |
| "!rm -rf /root/.tubeup/downloads/*" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": { | |
| "cellView": "form", | |
| "id": "FuYDBrauns61" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "#@title View pipx information\n", | |
| "!pipx list --json" | |
| ] | |
| } | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "provenance": [] | |
| }, | |
| "kernelspec": { | |
| "display_name": "Python 3", | |
| "name": "python3" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 0 | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Google Colab: https://colab.research.google.com/gist/exurd/da8e1370a71027b9fe8e4f118e4c584e