Last active
July 15, 2017 06:40
-
-
Save tomhiggins/fdcc79906af204eec5f7ff3a1fae4020 to your computer and use it in GitHub Desktop.
Move a Soundcloud Item, Playlist, User file to an existing Archive.org Item
This file contains 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
#!/bin/bash | |
# Move a Soundcloud item/playlist to a Archive.org iten leaving a copy on the local drive | |
# (thanks to @kragen and kevin for impetus) | |
# | |
# Please read the Terms of Use on archive.org, tl;dr you can move files there if you are the creator or they are | |
# in the Public Domain. Please also go back and add any metadata to the things you move up to archive.org. | |
# https://archive.org/about/faqs.php#Uploading_Content | |
# | |
# Usage | |
# ./soundcloudtoia.sh URL_of_the_SoundCloud_item Archive.org_identifier_to_move_files_into | |
# | |
# Requirements | |
# youtube-dl https://github.com/rg3/youtube-dl | |
# InternetArchive Cli Tools https://internetarchive.readthedocs.io/en/latest/installation.html | |
iatarget=$2 | |
sctarget=$1 | |
[ ! -d "$iatarget" ] && mkdir "$iatarget" | |
cd "$iatarget" | |
youtube-dl -i -w --write-description --write-info-json --no-progress "$sctarget" | |
wait ${!} | |
for scfile in *mp3 | |
do | |
ia upload "$iatarget" "$scfile" --metadata="mediatype:audio" | |
done | |
for scfile in *description | |
do | |
ia upload "$iatarget" "$scfile" --metadata="mediatype:texts" | |
done | |
cat *json |grep -Pom 1 '"thumbnail": "\K[^"]*'>thumbnails.lst | |
wget -i thimbnails.lst | |
for scfile in *jpg | |
do | |
ia upload "$iatarget" "$scfile" --metadata="mediatype:image" | |
done | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requirements
youtube-dl https://github.com/rg3/youtube-dl
InternetArchive Cli Tools https://internetarchive.readthedocs.io/en/latest/installation.html
Please read the Terms of Use on archive.org, tl;dr you can move files there if you are the creator or they are
in the Public Domain. Please also go back and add any metadata to the things you move up to archive.org.
https://archive.org/about/faqs.php#Uploading_Content
5 Run soundcloudtoia.sh
Usage
./soundcloudtoia.sh URL_of_the_SoundCloud_item Archive.org_identifier_to_move_files_into
URL_of_the_SoundCloud_item = the full url of the Soundcloud user page, item page, or playlist page that lists the items you want to move
Archive.org_item_to_move_files_into = the archive.org identifier of the item you created to house the files. Use only the identifier and not the full url (ex. SCArchiveForUser and not https://archive.org/details/SCArchiveForUser