Skip to content

A Youtube video downloader and reuploader written in Python

License

Notifications You must be signed in to change notification settings

victoria-mckinney/yspin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yspin

This library is a little Youtube video handler that I wrote for archiving videos. You can download videos from Youtube into folders, and then parse these folders and reupload them to a single channel.

Yspin requires ffmpeg, pytube, urllib, and playwright.

Usage

Downloading

To download a list of videos, you must create a text file with all the links you need. Be sure each link is on its own line, and that you do not have blank lines. You can then pass the filepath into download_from_file, or if it's in the current directory and named videos.txt, you can call the function with no arguments. The program will then spawn many processes, each downloading a chunk of links from Youtube. Be sure you have a __main__, with any functions that must be called for each process being out of __main__, and any that should not be called being inside of it.

Here is an example of a list of videos:

https://www.youtube.com/watch?v=IJ4kPmiUP_Y
https://www.youtube.com/watch?v=-Vvex2oThtA
https://www.youtube.com/watch?v=yVHPL80z59w

You will now have a bunch of subfolders with the following format:

videos 
└─── Video_name_1
│   │──   desc.txt
│   │──   thumb.png
│   │──   title.txt
│   \──   vid.mp4
│   ...

These will be used to properly reupload videos later.

Reuploading

To reupload your folders, you need to call upload_to_channel, passing the path to your "secrets" json file (or nothing if it's called secrets.json.

The file should be in the following format:

{
  "link": "https://www.youtube.com/channel/...",
  "username": "name@site",
  "password": "your_silly_password"
}

There are slight variations you can use, but I won't go into them here as they aren't the intended format.

You should now see your videos being reuploaded. Unlike with the downloader, the reuploader should not be run as multiple processes. Youtube will flag your account as being hacked, and will sign you out. The same goes for uploading too quickly. You can change the amount of time between chunked uploads, but be careful.

You also need to verify your Youtube account to upload thumbnails. If you do not, the reuploader will time out. You may also have issues with upload limits if you are reuploading a lot of videos.

Disclaimer

DO NOT use this to pass someone else's content as your own. This was only made for saving videos from many sources for easy viewing. I do not condone the use of yspin for malicious purposes. If you modify the program or use it for another purpose, that's on you.

Notes

This program was meant for archival purposes. It is not meant to be extremely portable, nor flexible. If you run into any issues with the intended usage, let me know; otherwise, you're on your own.

About

A Youtube video downloader and reuploader written in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%