faissaloo / SponSkrub

Strip advertisements from downloaded YouTube videos
GNU General Public License v3.0
178 stars 7 forks source link

Video IDs that start with `-` are treated as invalid arguments #39

Closed benrr101 closed 1 year ago

benrr101 commented 1 year ago

Steps to repro:

Expected output:

Actual output:

Missing arguments: output_filename

Unrecognised arguments: -dxAtKN4eJs

Usage: sponskrub [-h] [-chapter] [-exclude-sponsors] [-include-intros] [-include-outros] [-include-interactions] [-include-selfpromo] [-include-nonmusic] [-keep-date] [-proxy proxy] [-api-url url] video_id input_filename output_filename

SponSkrub is an application for removing sponsors from downloaded Youtube video
 files, it requires an internet connection in order to consult the SponsorBlock
 database and ffmpeg must be installed.

Options:
 -h
   Display this help string

 -chapter
         Mark sponsor spots as chapters rather than removing them.
         Faster but leads to bigger file sizes

 -exclude-sponsors
   Exclude sponsors from the categories to be cut or marked as chapters

 -include-intros
   Cut or mark as chapters introductions (e.g: 'welcome to my video!')

 -include-outros
   Cut or mark as chapters outros (e.g: 'see you next week')

 -include-interactions
   Cut or mark as chapters interactions (e.g: 'like this video if you liked it!')

 -include-selfpromo
   Cut or mark as chapters self promotion (e.g: 'visit our merch store')

 -include-nonmusic
   Cut or mark as chapters portions of music videos without music

 -api-url
   Specify the url where the API is located, defaults to sponsor.ajay.app

 -no-id
   Searches for sponsor data by the partial hash of the video id instead of
         directly requesting it.
         This adds a degree of privacy, but is slightly slower and uses more bandwidth.

 -keep-date
   Give the output file the same modification date as the input file.

 -proxy
   Allows you to specify a proxy to route any requests through

 -force-http
   By default sponskrub connects to the API via HTTPS, use this to force HTTP

Additional notes: I'm not amazing at bash scripting, so it's entirely possible I balls'd up quoting the video ID. If so, sorry about that, feel free to close and berate me.

pukkandan commented 1 year ago

Use sponskrub -- -dxAtKN4eJs ..., the -- telling the program that remaining args are not switches. See https://github.com/faissaloo/SponSkrub/issues/8

benrr101 commented 1 year ago

Sounds good, thank you for that.