noctuid / mpv-webtorrent-hook

Stream torrents in mpv using webtorrent-cli
GNU General Public License v3.0
90 stars 4 forks source link

How to use the select webtorrent flag? #11

Open DomBito opened 3 years ago

DomBito commented 3 years ago

Only way I can think of is to write a external shell script to change the webtorrent-hook.conf on the fly. Isn't there a native way to use the webtorrent select flag with mpv-webtorrent-hook so that I can still just use a mpv command?

noctuid commented 3 years ago

I don't think --playlist-start can be used since the playlist won't exist initially, and even if you specify --select, I don't think it will do anything because this script plays the exact webtorrent urls not the server url. This script can remember and restore your position. If that's not sufficient, I could add a select option, but I'm not sure I understand the use case. It seems like it would be quicker to just cycle through the playlist rather than specify an index or especially a filename on the commandline unless it was a torrent with tons of files.

I don't think I can add new flags to mpv, but you can set script opts with --script-opts, so I could add support for something like mpv --script-opts=webtorrent-hook-select=3 <magnet>. Alternatively, the selection could be specified as part of the torrent identifier (e.g. webtorrent@3@://<magnet link>), which would also work for torrents pasted into the playlist. Would you find a select option useful? And would you want to specify the index or the filename?