Kaynağa Gözat

Allow more general use of the update script
Allow more general use of the critrole script for G&S content
Add a NoSurvivors script

Zachary Kotlarek 11 yıl önce
ebeveyn
işleme
d2320759b2
3 değiştirilmiş dosya ile 28 ekleme ve 1 silme
  1. 20 0
      yt/critrole.pl
  2. 7 0
      yt/nosurvivors.sh
  3. 1 1
      yt/subscribe.pl

+ 20 - 0
yt/critrole.pl

@@ -18,6 +18,26 @@ if (defined($ENV{'DEBUG'}) && $ENV{'DEBUG'} =~ /(\d+)/) {
 	$DEBUG = $1;
 }
 
+# ENV Parameters
+if (exists($ENV{'TOP_URL'})) {
+	$TOP_URL = $ENV{'TOP_URL'};
+	if ($DEBUG) {
+		print STDERR 'Using ENV TOP_URL: ' . $TOP_URL . "\n";
+	}
+}
+if (exists($ENV{'EP_MATCH'})) {
+	$EP_MATCH = qr/${ENV{'EP_MATCH'}}/i;
+	if ($DEBUG) {
+		print STDERR 'Using ENV EP_MATCH: qr/' . $ENV{'EP_MATCH'} . "/i\n";
+	}
+}
+if (exists($ENV{'INI_PATH'})) {
+	$INI_PATH = $ENV{'INI_PATH'};
+	if ($DEBUG) {
+		print STDERR 'Using ENV INI_PATH: ' . $INI_PATH . "\n";
+	}
+}
+
 # Setup LWP
 my $ua = LWP::UserAgent->new();
 if (!$ua) {

+ 7 - 0
yt/nosurvivors.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+export INI_PATH="${1}/extra_videos.ini"
+export TOP_URL='http://geekandsundry.com/tag/no-survivors/'
+export EP_MATCH='^https?\:\/\/geekandsundry.com\/[^\/]+\/$'
+
+exec ~/bin/video/yt/critrole.pl

+ 1 - 1
yt/subscribe.pl

@@ -264,7 +264,7 @@ if ($ID =~ /^\s*None\s*$/i) {
 
 # Run the local "update" script if any
 {
-	my @update = ('./update', '');
+	my @update = ('./update', $DIR);
 	if (can_run($update[0])) {
 		if ($DEBUG) {
 			print STDERR "Executing local update script...\n";