Skip to content

Instantly share code, notes, and snippets.

@kaveenr
Created July 24, 2021 07:06
Show Gist options
  • Save kaveenr/afafdb77ddc2bb89f6c65d3b68e3621a to your computer and use it in GitHub Desktop.
Save kaveenr/afafdb77ddc2bb89f6c65d3b68e3621a to your computer and use it in GitHub Desktop.
FreeFange Archive YT

FreeRange YT Archive

Requirments

VPS Running Alping

Install Dependencies

apk add youtube-dl
apk add screen
apk add python3
apk add py3-pip

Install Internet Archive CLI

pip3 install internetarchive

Run Instrcutions

  • Configure IA
ia configure
  • Download Videos
youtube-dl -i <channel|playlist>
  • Make Upload Sheet
python buildCsv.py > upload.csv
  • Upload to Archive
ia upload --spreadsheet=upload.csv
import os comedy intro title-DhK2-Gzi4Js.mp4
less
sp_chars = [';', ':', '!', "*","(",")","&", "'",","] pawula samaga film ekak balanna-wvI8DN6vEw8.mp4
upload.csv
print("identifier,file,description,subject[0],subject[1],subject[2],title,creator,date,collection") localhost:~/archive# python buildCsv.py > upload.csv
for i in os.listdir("."): localhost:~/archive# ia upload --spreadsheet=upload.csv
if i.endswith(".mp4"): adera_seenuwa_from_torana_archive__ehy:
name= " ".join(i.split("-")[0:-1]) uploading Adera Seenuwa from Torana Archive-_ehY-MsY48Y.mp4: 100%|██████████████████████████████████████| 11/11 [00:02<00:00, 4.32MiB/s]
iden= "_".join(name.strip().lower().split(" "))[0:99] monkey_dance_sinhala_dubbed_movie_from_torana_archives:
iden= filter(lambda i: i not in sp_chars, iden) uploading Monkey Dance Sinhala dubbed movie from Torana Archives-EKl9cD8J6dw.mp4: 100%|█████████████████| 12/12 [00:00<00:00, 13.14MiB/s]
iden= iden[0].replace(".","").replace("-","").replace("_","") + iden[1:99] semaneris_ayya_jxyq1kl_d:
print(iden + ",\"" + i + "\",\"" + name + "\",,,,\"" + name + "\",Torana Video Archive,,opensource_movies")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment