0x776b7364 / toggle.sg-download

Python script to automate Toggle.sg video downloads
MIT License
26 stars 18 forks source link

Input URLs from command line #2

Closed gromgit closed 9 years ago

gromgit commented 9 years ago

Just added a simple change that allows the user to specify multiple Toggle URLs at once on the command line, plus a shebang line (#!/usr/bin/env python) so Linux/Mac OS X users can execute the script directly with the correct interpreter. (I assume Python on Windows will treat it as a simple comment.)

Also updated README.md to add compatibility and installation notes for Ubuntu 15.04 and Mac OS X Mavericks.

jervis93 commented 9 years ago

hi @gromgit seems that it broke compatibilty for windows. i will try to fix the code but i do not have linux so i might need yr assistence

jervis93 commented 9 years ago

Hi I couldnt create a pull request.still an novice in github. I added in the check of unix, this should be able to fix the problem https://github.com/jervis93/toggle.sg-download

gromgit commented 9 years ago

Hi @jervis93!

What exactly do you mean by "broke compatibility for Windows"? I just fired up a Windows XP 32-bit VM, ran my modified script as-is with the video.bat script that was posted recently, and was able to download the 4 most recent On the Red Dot episodes in MP4 format with a single command-line invocation (URLs shortened for readability): video http://video.toggle.sg/.../ep126/330269 http://video.toggle.sg/.../ep127/330844 http://video.toggle.sg/.../ep128/331365 http://video.toggle.sg/.../ep129/332071

The only thing I couldn't get to work was ffmpeg, but that looks to be a library issue in my VM.

jervis93 commented 9 years ago

Hi I ran the code based on the latest commit. This is the error http://imgur.com/btzOOSL. But after importing sys, the code seems to work well.

Anyway after a night of thinking. I think I roughly know how to the single command-line invocation. Is it something like this. Not sure but u might want to add in to the readme for ease of use

python download_toggle_video.py URL1 URL2 URL3 URL4

gromgit commented 9 years ago

Argh, my bad. I corrected the import sys issue in my working copy, but forgot to copy the script back into my local source directory for committing. Will push out another pull request to fix that, and to add Windows invocation instructions to README.md (it's almost identical to Linux/Mac).

jervis93 commented 9 years ago

Haha its okay. My bad too, yesterday was too tired, so after the error, thought it might be an os issue. But today after verifying, i figured out everything. Anyway not too sure about yr point for ffmpeg since I dun really use cmd to download those links.

gromgit commented 9 years ago

The official Python installer takes special care to set up file associations for .py (and .pyc, I think) files, so that you can launch Python scripts by name. In the same way, I can open a Word document from the command line just by typing LatestResume.doc, without having to specify where the Word executable resides.