Just some scripts

Just some scripts

A bunch of Windows scripts, working on Win10 as of Jan. 1st, 2019, with yt-dl working as of Sep. 22nd, 2019. Legend: download code directory key

Audiovisual media downloader

Useful for backing media up directly from social networking sites. Originally from yt-dl.org, which I updated to include FFmpeg to merge audio/video and RTMPDump to download Flash files (details). I also renamed it so you just need to type in yt and not youtube-dl in your commands for efficiency. If you want to be extra safe, download the files listed above directly. If you don’t mind taking a risk, download the RAR file I compiled containing all of them in step one below. It should be safe but I cannot personally guarantee this.

  1. Download, unzip, and then copy YT scripts into a folder in your C:/ directory (ie. C:/yt)
  2. Enter command prompt/terminal (Windows: ⊞ Win + r, type in cmd)
  3. Type in cd c:/yt to enter the C:/yt directory.
  4. Type yt -U → to update to the latest release (do this often).
  5. Type in any of the following (get the spaces and capitalization right; file will be in your C:/yt folder.):
    • yt URL → Download highest quality video format
    • yt URL --video-password password → Download password-protected videos
    • yt URL --write-sub → Download subtitles (place both video and .vtt files in the same folder, open the video in VLC, enable under the “Subtitles” menu. More options here.)
    • yt -f 140 URL → Download audio in the m4a format
    • yt -x --audio-format mp3 URL → Download audio and then convert it to an mp3 format
    • yt -F URL → List all available download formats
    • yt -h → Help (ie list all options).

Note: URL = YouTube/Vimeo/Facebook/Reddit/TED/BBC/etc URL. Eg: yt youtu.be/tEz2Xc2MK2o will download the video; yt -f 140 https://www.youtube.com/watch?v=tEz2Xc2MK2o would download just the audio portion.

Torrent streaming

Using Peerflix on Windows to stream torrent magnet links directly in VLC.

  1. Install VLC and Node.js.
  2. Enter command prompt/terminal (Windows: ⊞ Win + r, type in cmd)
  3. Install Peerflix via terminal by typing in npm install -g peerflix
  4. Get Magnet link from torrent index (eg: MagnetDL)
  5. Enter peerflix "URL" --vlc (the quotes are necessary only for links containing ampersands (“&”)).
    Eg: peerflix magnet:?xt=urn:btih:ef330b39f4801d25b4245212e75a38634bfc856e --vlc

Batch song file renaming

Renaming song filenames to match iTunes tags.

  1. Download Steve MacGuire’s CustomRenamer (link) and EnableLUA (link) scripts. Location doesn’t matter.
  2. Back up your music library.
  3. Update the songs you want renamed in iTunes. Highlight these songs.
  4. Run EnableLUA.vbs. Not necessary but this disables some Windows settings enabling a progress bar to show up: useful for visualizing progress).
  5. Run CustomRenamer.vbs:
    • Choose your destination folder (a new one means new files will be created there; the same one means files in there will simply be renamed).
    • Choose your preferred filename format (eg <Name> (<Artist>, <Year>).
    • The default of Music\<Name> (<Artist>, <Year>) will create a /Music subfolder housing the changed tracks. iTunes will reference the new tracks as the correct ones wherever they are saved by the script.
    • Execute command. If you ran EnableLUA you might be asked to set up/use Internet Explorer. Allow this to see the progress bar.
    • If you’re renaming into the same folder it may ask you to delete duplicate files. Luckily you have a backup so go ahead and revisit after.
  6. Run EnableLUA.vbs to re-enable Windows default settings if you disabled them earlier.

Rendering charts and graphs using HTML

Right-click and download charts.html and open it in a text editor to edit the values within.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.