Fixed peertubetorrent

Because of https://github.com/Chocobozzz/PeerTube/pull/3746, the torrent URL is now different from the normal video url. This means the peertube API is needed to get the new torrent link.
This commit is contained in:
krisdoodle45 2021-11-01 11:11:48 +01:00 committed by GitHub
parent 2ddfa7ab0f
commit 5fa313013c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,5 +3,7 @@
# first argument is the video link, second is the quality (480 or 1080)
# 13/07/20 - Arthur Bais
link="$(echo "$1" | sed "s/w/download\/torrents/")""-$2.torrent"
instance=$(echo "$1" | sed "s/\/w.*//")
vidid=$(echo "$1" | sed "s/.*\///")
link=$(curl "$instance/api/v1/videos/$vidid" 2>/dev/null | grep -o "$instance/download/torrents/........-....-....-....-............-$2.torrent")
transadd "$link"