Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bd2bc6e301 | |||
| 0e3f461981 | |||
| f59bea6fcd |
2
source/3rdparty/tvrenamer
vendored
2
source/3rdparty/tvrenamer
vendored
Submodule source/3rdparty/tvrenamer updated: 7b9a3d95ef...3c47507500
@@ -145,7 +145,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug
|
|||||||
|
|
||||||
protected function normalise($name) {
|
protected function normalise($name) {
|
||||||
$normalised_name = $name;
|
$normalised_name = $name;
|
||||||
if (preg_match('/(?:\[ www.[a-zA-Z0-9.]+ \] - )?(.*?)([\s.]+us)?([\s\.](19|20)\d{2})?[\s\.](\[?\s*\d+x\d+\s*\]?|s(?:eason ?)?\d+[.-_ ]?e(?:pisode ?)?\d+|\d{3,4}).*/i', $normalised_name, $matches)) {
|
if (preg_match('/(?:\[ www.[a-zA-Z0-9.]+ \] - )?(.*?)(?<!the)([\s.]+us)?([\s\.](19|20)\d{2})?[\s\.](\[?\s*\d+x\d+\s*\]?|s(?:eason ?)?\d+[.-_ ]?e(?:pisode ?)?\d+|\d{3,4}).*/i', $normalised_name, $matches)) {
|
||||||
$normalised_name = $matches[1];
|
$normalised_name = $matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (preg_match('/(?:(?:[\s\.](?:19|20)\d{2})?[\s\.])?(?:\d+(\d{2})(?!\d|[\s\.](?:\d+x\d+|s\d[._-]?+ep?\d+))|\[?\s*\d+x(\d+)\s*\]?|s(?:eason ?)?\d+e(?:pisode ?)?(\d+))/i', $name, $matches)) {
|
if (preg_match('/(?:^the.\d+)?(?:(?:[\s\.](?:19|20)\d{2})?[\s\.])?(?:\d+(\d{2})(?!\d|[\s\.](?:\d+x\d+|s\d[._-]?+ep?\d+))|\[?\s*\d+x(\d+)\s*\]?|s(?:eason ?)?\d+e(?:pisode ?)?(\d+))/i', $name, $matches)) {
|
||||||
return $set_episode($matches);
|
return $set_episode($matches);
|
||||||
} elseif (preg_match('/^(\d+)/i', $name, $matches)) {
|
} elseif (preg_match('/^(\d+)/i', $name, $matches)) {
|
||||||
return $set_episode($matches);
|
return $set_episode($matches);
|
||||||
@@ -334,41 +334,41 @@ EOSH;
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function forgetDownload($series, $season, $episode) {
|
protected function forgetDownload($series, $season, $episode) {
|
||||||
$base_url = $this->config->get('sources.TV.flexget-url');
|
#$base_url = $this->config->get('sources.TV.flexget-url');
|
||||||
$username = $this->config->get('sources.TV.flexget-username');
|
#$username = $this->config->get('sources.TV.flexget-username');
|
||||||
$password = $this->config->get('sources.TV.flexget-password');
|
#$password = $this->config->get('sources.TV.flexget-password');
|
||||||
|
#
|
||||||
// Pad series and episode numbers with leading zeroes for flexget
|
#// Pad series and episode numbers with leading zeroes for flexget
|
||||||
$season = str_pad($season, 2, '0', STR_PAD_LEFT);
|
#$season = str_pad($season, 2, '0', STR_PAD_LEFT);
|
||||||
$episode = str_pad($episode, 2, '0', STR_PAD_LEFT);
|
#$episode = str_pad($episode, 2, '0', STR_PAD_LEFT);
|
||||||
|
#
|
||||||
$url = "{$base_url}execute/";
|
#$url = "{$base_url}execute/";
|
||||||
$data = array(
|
#$data = array(
|
||||||
'options' => "--series-forget '{$series}' 's{$season}e{$episode}'",
|
# 'options' => "--series-forget '{$series}' 's{$season}e{$episode}'",
|
||||||
'submit' => 'Start Execution',
|
# 'submit' => 'Start Execution',
|
||||||
);
|
#);
|
||||||
|
#
|
||||||
DownloadDispatcher_LogEntry::debug($this->log, "Sending flexget series-forget command to {$url} with options '{$data['options']}'.");
|
#DownloadDispatcher_LogEntry::debug($this->log, "Sending flexget series-forget command to {$url} with options '{$data['options']}'.");
|
||||||
|
#
|
||||||
$request = new HttpRequest($url, HTTP_METH_POST, array(
|
#$request = new HttpRequest($url, HTTP_METH_POST, array(
|
||||||
'httpauth' => "{$username}:{$password}",
|
# 'httpauth' => "{$username}:{$password}",
|
||||||
'httpauthtype' => HTTP_AUTH_BASIC,
|
# 'httpauthtype' => HTTP_AUTH_BASIC,
|
||||||
));
|
#));
|
||||||
$request->setPostFields($data);
|
#$request->setPostFields($data);
|
||||||
|
#
|
||||||
$response = $request->send();
|
#$response = $request->send();
|
||||||
DownloadDispatcher_LogEntry::debug($this->log, "Response code: {$response->getResponseCode()}.");
|
#DownloadDispatcher_LogEntry::debug($this->log, "Response code: {$response->getResponseCode()}.");
|
||||||
|
#
|
||||||
if ($response->getResponseCode() == 200) {
|
#if ($response->getResponseCode() == 200) {
|
||||||
$response_body = $response->getBody();
|
# $response_body = $response->getBody();
|
||||||
if (preg_match('/Removed episode .* from series .*/', $response_body)) {
|
# if (preg_match('/Removed episode .* from series .*/', $response_body)) {
|
||||||
DownloadDispatcher_LogEntry::info($this->log, "Successfully made flexget forget about {$series} s{$season}e{$episode}.");
|
# DownloadDispatcher_LogEntry::info($this->log, "Successfully made flexget forget about {$series} s{$season}e{$episode}.");
|
||||||
} else {
|
# } else {
|
||||||
DownloadDispatcher_LogEntry::warning($this->log, "Failed to make flexget forget about {$series} s{$season}e{$episode}.");
|
# DownloadDispatcher_LogEntry::warning($this->log, "Failed to make flexget forget about {$series} s{$season}e{$episode}.");
|
||||||
}
|
# }
|
||||||
} else {
|
#} else {
|
||||||
DownloadDispatcher_LogEntry::warning($this->log, "Failed to communicate with flexget webui.");
|
# DownloadDispatcher_LogEntry::warning($this->log, "Failed to communicate with flexget webui.");
|
||||||
}
|
#}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user