I changed some things, I don't actually remember what because I did it yesterday
This commit is contained in:
parent
63015b6517
commit
114fec18f6
18
ytbrowser.pl
18
ytbrowser.pl
@ -47,7 +47,7 @@ open(WATCH, $playlistFile) or goto SKIPWATCHLOAD;
|
||||
my $readFile = "";
|
||||
while(<WATCH>) { $readFile .= $_; }
|
||||
close(WATCH);
|
||||
@watchlist = @{decode_json($readFile)};
|
||||
if ($readFile) { @watchlist = @{decode_json($readFile)}; }
|
||||
SKIPWATCHLOAD:
|
||||
my %tests = map { $_->{id} => 1 } @watchlist;
|
||||
|
||||
@ -153,7 +153,7 @@ open(CACHED, $cachedFile) or goto SKIPCACHED;
|
||||
$readFile = "";
|
||||
while (<CACHED>) { $readFile .= $_; }
|
||||
close(CACHED);
|
||||
@videos = @{decode_json($readFile)};
|
||||
if ($readFile) { @videos = @{decode_json($readFile)}; }
|
||||
SKIPCACHED:
|
||||
|
||||
`touch $debugFile`;
|
||||
@ -204,6 +204,15 @@ $suggestions->set_binding( sub {
|
||||
$suggestions->draw();
|
||||
$wlist->draw();
|
||||
}, "p");
|
||||
$wlist->set_binding( sub {
|
||||
my $video = splice(@watchlist,$wlist->get_active_id(),1);
|
||||
$cui->status("Playing Video, controls will resume once video is compelte\n Currently Playing: ".splice(@watchArray,$wlist->get_active_id(),1));
|
||||
`mpv --ytdl-raw-options=cookies=$cookiesFile,mark-watched= --terminal=no https://www.youtube.com/watch?v=$video->{id}`;
|
||||
sync2files();
|
||||
$win->draw();
|
||||
$suggestions->draw();
|
||||
$wlist->draw();
|
||||
} , "p");
|
||||
$suggestions->set_binding( sub {
|
||||
splice(@videos,0,scalar(@videos));
|
||||
splice(@suggestArray,0,scalar(@suggestArray));
|
||||
@ -222,6 +231,11 @@ $suggestions->set_binding( sub {
|
||||
my $vid = $videos[$suggestions->get_active_id()];
|
||||
$cui->status("Video: ".$vid->{title}."\nChannel: ".$vid->{channel}."\nRuntime: ".$vid->{runtime}."\nPublished: ".$vid->{published}."\nURL: https://www.youtube.com/watch?v=".$vid->{id});
|
||||
}, "i");
|
||||
$wlist->set_binding( sub {
|
||||
my $vid = $videos[$wlist->get_active_id()];
|
||||
$cui->status("Video: ".$vid->{title}."\nChannel: ".$vid->{channel}."\nRuntime: ".$vid->{runtime}."\nPublished: ".$vid->{published}."\nURL: https://www.youtube.com/watch?v=".$vid->{id});
|
||||
|
||||
} , "i");
|
||||
|
||||
$suggestions->focus();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user