-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
rel_old
executable file
·146 lines (132 loc) · 5.5 KB
/
rel_old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/usr/bin/perl
# vim:ft=perl:
# abstract: flexget parser
use strict;
my $flexlog = "$ENV{XDG_DATA_HOME}/flexget/flexget.log";
open(LOG,$flexlog) || die "$flexlog does not exist?!\n";
my @releases = <LOG>;
close(LOG);
my (@episodes, @floss, @music, @mvids);
foreach my $release(@releases) {
next unless($release =~ /Downloading:/);
$release =~ s/(?:\w+\s+){2}\w+: //;
if($release =~ /(S[0-9]+)?(E[0-9]+)?(.*TV)|VHS|SWEDISH/i) {
push(@episodes, $release);
}
elsif($release =~ /FLOSS/) {
push(@floss, $release);
}
elsif($release =~ /.+(_|-|-_-|_-_)+x264-[0-9]{4}/) {
push(@mvids, $release);
}
else {
push(@music, $release);
}
}
my $reRecurring = 'S[0-9]{2}E[0-9]{2}';
my $reWanted = 'fringe|house$|smallville|blasningen|the\.real\.hustle
|mythbusters|simpsons|talang|uppdrag\.granskning
|parkaour';
my $reNew = 'S01E01';
my $reDocu = 'do(c|k?)u(ment.+)?|(discovery|history)\.(channel)?
|national\.geographic|colossal\..+';
my $reSport = 'EPL|WWE|UFC|UEFA|Rugby|La\.Liga|Superleague
|Allsvenskan|Formula\.Ford';
my $reSwe = 'swedish';
my $rePsy = 'PsyCZ|MYCEL|UPE|HiEM|PSi';
my $reRap = '.+-(H3X|wAx|CMS|BFHMP3|WHOA|RNS|C4|UMT|0MNi(.+)?
|FRAY(.+)?)$';
my $reRock = 'LzY|qF|SRP|NiF';
my $reHS = 'TALiON|HB';
my $reVA = 'VA(-|_-_).+';
my $reWEB = '.+(-WEB-)';
my $reCDS = '.+(-CDS-)';
my $reCDM = '.+(-CDM-)';
my $reCDA = '.+(-CDA-)';
my $reDAB = '.+(-DAB-)';
my $reVLS = '.+(-VLS-)';
my $reCABLE = '.+(-CABLE-)';
my $reLIVE = 'Live_(on|at|in)';
my $colorNone = "\033[0m";
my $colorWanted = "\033[38;5;202m";
my $suffixNew = "\033[38;5;196mNew Show\033[0m";
my $suffixDocu = "\033[38;5;100mDocumentary\033[0m";
my $suffixSwe = "\033[38;5;44mSwedish\033[0m";
my $suffixSport = "\033[38;5;144mSport\033[0m";
my $suffixRe = "\033[38;5;198mNew Episode\033[0m";
my $suffixPsy = "\033[38;5;111mPsychedelic\033[0m";
my $suffixRap = "\033[38;5;129mHip-Hop\033[0m";
my $suffixRock = "\033[38;5;192mRock\033[0m";
my $suffixHS = "\033[38;5;83mmHardstyle\033[0m";
my $suffixVA = "\033[38;5;149mVA\033[0m";
my $suffixWEB = "\033[38;5;199mWEB\033[0m";
my $suffixCDS = "\033[38;5;212mSingle\033[0m";
my $suffixCDM = "\033[38;5;232mMaxi\033[0m";
my $suffixCDA = "\033[38;5;132mAlbum\033[0m";
my $suffixDAB = "\033[38;5;22mAlbum\033[0m";
my $suffixVLS = "\033[38;5;220mVinyl\033[0m";
my $suffixCABLE = "\033[38;5;130mCable\033[0m";
my $suffixLIVE = "\033[38;5;79mLive\033[0m";
#printf("\033[38;5;154m%40s\033[0m\n",'TV TODAY') unless !@episodes;
foreach my $rel(sort(@episodes)) {
chomp($rel);
$rel = sprintf("%60s", $rel);
$rel = sprintf("%.60s",$rel);
$rel = sprintf("%s $suffixRe", $rel) if $rel =~ /$reRecurring/ix;
$rel = sprintf("%s $suffixDocu", $rel) if $rel =~ /$reDocu/ix;
$rel = sprintf("%s $suffixSwe", $rel) if $rel =~ /$reSwe/ix;
$rel = sprintf("%s $suffixSport", $rel) if $rel =~ /$reSport/ix;
$rel = sprintf("%s $suffixNew", $rel) if $rel =~ /$reNew/ix;
$rel = sprintf("$colorWanted%s$colorNone",$rel) if $rel =~ /$reWanted/xi;
printf("\033[38;5;196mTV\033[0m %s\n", $rel);
}
#printf("\033[38;5;154m%40s\033[0m\n", "MUSIC TODAY") unless !@music;
printf("%40s\n", '-') unless !@episodes;
foreach my $rel(@music) {
chomp($rel);
$rel = sprintf("%60s", $rel);
$rel = sprintf("%.60s", $rel);
$rel = sprintf("%s $suffixPsy", $rel) if $rel =~ /$rePsy/x;
$rel = sprintf("%s $suffixRap", $rel) if $rel =~ /$reRap/x;
$rel = sprintf("%s $suffixRock", $rel) if $rel =~ /$reRock/x;
$rel = sprintf("%s $suffixHS", $rel) if $rel =~ /$reHS/x;
$rel = sprintf("%s $suffixVA", $rel) if $rel =~ /$reVA/x;
$rel = sprintf("%s $suffixWEB", $rel) if $rel =~ /$reWEB/x;
$rel = sprintf("%s $suffixCDS", $rel) if $rel =~ /$reCDS/x;
$rel = sprintf("%s $suffixCDM", $rel) if $rel =~ /$reCDM/x;
$rel = sprintf("%s $suffixCDA", $rel) if $rel =~ /$reCDA/x;
$rel = sprintf("%s $suffixDAB", $rel) if $rel =~ /$reDAB/x;
$rel = sprintf("%s $suffixVLS", $rel) if $rel =~ /$reVLS/x;
$rel = sprintf("%s $suffixCABLE", $rel) if $rel =~ /$reCABLE/x;
$rel = sprintf("%s $suffixLIVE", $rel) if $rel =~ /$reLIVE/x;
printf("\033[38;5;197mMU\033[0m %s\n", $rel);
}
#printf("\033[38;5;100m%40s\033[0m\n", "MVIDS TODAY") unless !@mvids;
printf("%40s\n", '-') unless !@music;
foreach my $rel(@mvids) {
chomp($rel);
$rel = sprintf("%60s", $rel);
$rel = sprintf("%.60s", $rel);
$rel = sprintf("%s $suffixPsy", $rel) if $rel =~ /$rePsy/x;
$rel = sprintf("%s $suffixRap", $rel) if $rel =~ /$reRap/x;
$rel = sprintf("%s $suffixRock", $rel) if $rel =~ /$reRock/x;
$rel = sprintf("%s $suffixHS", $rel) if $rel =~ /$reHS/x;
$rel = sprintf("%s $suffixVA", $rel) if $rel =~ /$reVA/x;
$rel = sprintf("%s $suffixWEB", $rel) if $rel =~ /$reWEB/x;
$rel = sprintf("%s $suffixCDS", $rel) if $rel =~ /$reCDS/x;
$rel = sprintf("%s $suffixCDM", $rel) if $rel =~ /$reCDM/x;
$rel = sprintf("%s $suffixCDA", $rel) if $rel =~ /$reCDA/x;
$rel = sprintf("%s $suffixDAB", $rel) if $rel =~ /$reDAB/x;
$rel = sprintf("%s $suffixVLS", $rel) if $rel =~ /$reVLS/x;
$rel = sprintf("%s $suffixCABLE", $rel) if $rel =~ /$reCABLE/x;
$rel = sprintf("%s $suffixLIVE", $rel) if $rel =~ /$reLIVE/x;
printf("\033[38;5;226mMV\033[0m %s\n", $rel);
}
print "\n";
if(@floss) {
printf("%30s\n", 'FLOSS WEEKLY');
printf("%30s\n", '------------');
foreach my $floss(@floss) {
printf(" %s", $floss);
}
}