This commit is contained in:
Alexander Lehmann 2023-08-31 23:46:34 +02:00
parent e9a7abae93
commit c41d49483a
1 changed files with 34 additions and 0 deletions

34
peertube_backup.pl Normal file
View File

@ -0,0 +1,34 @@
#! perl
use strict;
my $wget="c:/tools/wget/wget.exe";
my $transmisson="\"c:/Program Files/Transmission/transmission-remote.exe\"";
my $path="d:/peertube_backup";
system("$wget -nc https://cliptube.org/feeds/videos.atom?accountName=alexlehm -O videos.atom");
open(XML, "videos.atom");
while(<XML>) {
chop;
if(m@<link href="(.*/w/.*)"@) {
my $url=$1;
$url=~m@/w/(.*)@;
my $id=$1;
$url =~ s@/w/@/api/v1/videos/@;
system("$wget -nc $url");
my $torrent="";
open(FILE, $id);
while(<FILE>) {
if(m@"torrentDownloadUrl":"([^\"]*-1080.torrent)"@) {
$torrent=$1;
system("$transmisson -w $path -a $torrent");
}
}
close FILE;
}
}
close XML;