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: code directory key

YouTube 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.

  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):
    yt URL → Download highest quality video format.
    yt -f 140 URL → Download m4a music 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 (including most variations of all)
    Eg: yt https://www.youtube.com/watch?v=tEz2Xc2MK2o will download this as a video;
    yt -f 140 youtu.be/tEz2Xc2MK2o would download just the audio portion.
  6. Downloaded file is in your C:/yt folder.

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

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.