GithubHelp home page GithubHelp logo

dchang0 / torrentwatch-xa Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 3.0 1.68 MB

Resurrection of TorrentWatch-X automatic RSS/Atom torrent episode downloader (broadcatcher) with the extra capability of handling anime torrents

License: GNU General Public License v2.0

Shell 0.64% PHP 84.05% CSS 3.71% HTML 0.71% JavaScript 10.62% Hack 0.26%
torrentwatch-x torrentwatch download-torrents download-torrents-automatically torrent-downloader anime-downloader download-anime torrent-rss-feed torrent-atom-feed transmission-daemon

torrentwatch-xa's People

Contributors

dchang0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

torrentwatch-xa's Issues

Feeds update only when rss cache is cleared

I've only been running this a few days but have noticed that the program doesn't update the feeds shown or download anything until I click "Empty Cache > Clear Cache > Feeds"

Is there a PHP command I can run alongside the existing cronjob that will clear the feed cache?

Running the December 1, 2020 release.

Magnet info not written to watch folder

According to the usage.md, if there is no torrent file linked in the source rss feed, magnet info will be written to the watch folder if using one.

I am using a watch folder (which works great for torrent files), but for some reason magnet info isn't being written to it.

 

Specifically, I've mirrored a couple of source site's RSS feeds outside of a cloudflare enclosure.

One feed provides links to torrent files & magnet links (this feed works fine)

The other feed only provides magnet links.

 

There is no longer an issue with TWXA refreshing (as both feeds are not behind cloudflare), so - to test - I found a tv show in the "magnet only" feed.

I clicked the downward arrow next to it and then clicked "Download"

Nothing was downloaded or written to the watch directory.

 

In other directions, is adding qbittorrent functionality as simple as copying & modifying the transmission-related bits?

Torrentwatch-xa feed list not syncronized with feed source

In theory, every 15 minutes Torrentwatch-xa should pull the latest RSS feed from the source.

In theory, should I visit the website of the source, the available items listed there should match within ±15 minutes of what Torrentwatch-xa is showing as available.

My Torrentwatch-xa is regularly out of this sync range (again, deleting the feed cache brings everything back into sync), sometimes for more than an hour.

 

So, either TW-XA isn't pulling the feeds every 15 minutes or it's pulling them but not parsing them.

Writing torrents to Fat, Fat32 or Exfat volumes can create error

If the torrent name or filename contains characters such as ':' that are illegal in FAT derivative filesystems, the torrent path passed to transmission can result in an error and a failed download.

Optional strict filename character filter should possibly be implemented.

May Also be a problem on NTFS and HPFS, although I have never observed it there.

I spotted this when I moved the torrent download directory from an internal linux ext4 volume to an external exfat volume because of space constraints. I will add a small ext4 volume as a workaround, but it would be useful to have the constraint.

Update

How do you update the program without having to go through all the steps again
I am trying the .sh install script but it keeps saying Cannot find new torrentwatch-xa lib tree to install; exiting.

Some ignored favorite batch torrents are displayed as "Previously Downloaded"

Hi dchan0,

as you wished i opened an issues for this, although the behavior changed from the description in the other issue #4. Precondition was also that i manually emptied dl_cache directory after first open the installation in the browser, then emptied the browser cache.

OS: Linux Mint 18.3 64-bit
Browser: Chromium (Version 66.0.3359.181 (Official Build))
torrenwatch-xa 1.1.0 (from master)

  • All "2xFULL" of the batches are now shown as ignored.
  • One still shows as the title says. Difference for this one is that it is matched as "2x2018". Debug level log:

2018-07-08T08:47:59+02:00 ERR: No torrent hash in cache file: /var/lib/torrentwatch-xa/dl_cache/dl_westworld s02 2018 solod rus webdlrip
2018-07-08T08:47:59+02:00 INF: Equiv. in cache; ignoring: westworld s02 2018 solod rus webdlrip

A "dl_" file is also created in the dl_cache directory.

Also one thing i noticed is, that after pressing "clear cache All" and watching the dl_cache directory. It deletes all files (except README) and rebuilds the caches immediately. After the process is finished the "Clear Cache" dialog still remains open. Shouldn't it close when it's finished?

Greetings

18.04

Think something broke the program with the update

$v) { unset($process[$key][$k]); if (is_array($v)) { $process[$key][stripslashes($k)] = $v; $process[] = &$process[$key][stripslashes($k)]; } else { $process[$key][stripslashes($k)] = stripslashes($v); } } } unset($process); } // parses commands sent from web UI (usually torrentwatch-xa.js) function parse_options($twxa_version) { global $html_out, $config_values; array_keys($_GET); $commands = array_keys($_GET); if (empty($commands)) { return false; } if (strpos($commands[0], '/') === 0) { $commands[0] = preg_replace("/^//", '', $commands[0]); } switch ($commands[0]) { case 'getClientData': echo getClientData(); exit; case 'delTorrent': if (isset($_REQUEST['trash'])) { if (isset($_REQUEST['checkCache'])) { $response = delTorrent($_REQUEST['delTorrent'], $_REQUEST['trash'], $_REQUEST['checkCache']); } else { $response = delTorrent($_REQUEST['delTorrent'], $_REQUEST['trash'], false); } } else { if (isset($_REQUEST['checkCache'])) { $response = delTorrent($_REQUEST['delTorrent'], false, $_REQUEST['checkCache']); } else { $response = delTorrent($_REQUEST['delTorrent'], false, false); } } echo "$response"; exit; case 'stopTorrent': echo stopTorrent($_REQUEST['stopTorrent']); exit; case 'startTorrent': echo startTorrent($_REQUEST['startTorrent']); exit; case 'moveTo': echo moveTorrent($_REQUEST['moveTo'], $_REQUEST['torHash']); exit; case 'updateFavorite': $response = update_favorite(); if (strpos($response, 'Error:') === 0) { echo "
$response
"; } break; case 'updateFeed': updateFeed(); break; case 'clearCache': clear_cache_by_cache_type(); break; case 'setGlobals': updateGlobalConfig(); break; case 'addFavorite': $feedLink = $_GET['rss']; foreach ($config_values['Feeds'] as $key => $feed) { if ($feed['Link'] == "$feedLink") { $idx = $key; } } if (($tmp = detectMatch(html_entity_decode($_GET['title'])))) { $GET['name'] = trim(strtr($tmp['favTitle'], ".", " ")); switch ($config_values['Settings']['Match Style']) { case "simple": $_GET['filter'] = trim($tmp['favTitle']); $_GET['quality'] = $tmp['qualities']; // Add to Favorites uses the qualities from the item for the new Favorite break; case "glob": $GET['filter'] = trim(strtr($tmp['favTitle'], " .", "???")); $_GET['filter'] .= ''; $_GET['quality'] = 'All'; // Add to Favorites makes the new Favorite accept all qualities break; case "regexp": $_GET['filter'] = trim($tmp['favTitle']); $_GET['quality'] = $tmp['qualitiesRegEx']; // Add to Favorites uses the detected qualities as a regex or . if no qualities detected } $_GET['feed'] = $_GET['rss']; $_GET['button'] = 'Add'; $_GET['downloaddir'] = 'Default'; $_GET['alsosavedir'] = 'Default'; $_GET['seedratio'] = ""; } else { $_GET['name'] = $_GET['title']; $_GET['filter'] = $_GET['title']; $_GET['quality'] = 'All'; $_GET['feed'] = $_GET['rss']; $_GET['button'] = 'Add'; $_GET['downloaddir'] = 'Default'; $_GET['alsosavedir'] = 'Default'; $_GET['seedratio'] = ""; } if ($config_values['Settings']['Default Feed All'] && $tmp['numberSequence'] > 0) { // set default feed to all only if serialized $_GET['feed'] = 'All'; } $response = update_favorite(); if ($response) { echo "$response"; } exit; case 'hide': /* $response = add_hidden(ucwords($_GET['hide'])); if ($response) { echo "ERROR:$response"; } else { $guess = detectMatch(html_entity_decode($_GET['hide'])); echo $guess['favTitle']; // use favTitle, not title } */ addHidden($_GET['hide']); exit; case 'delHidden': if (!empty($_GET['unhide'])) { delHidden($_GET['unhide']); // filter_input() will fail here because $_GET['unhide'] is an array } break; case 'dlTorrent': // Loaded via ajax foreach ($config_values['Favorites'] as $fav) { $guess = detectMatch(html_entity_decode($GET['title'])); $name = trim(strtr($guess['title'], ".", " ")); if ($name == $fav['Name']) { $downloadDir = $fav['Download Dir']; } } if ((!isset($downloadDir) || $downloadDir == "Default" ) && isset($config_values['Settings']['Download Dir'])) { $downloadDir = $config_values['Settings']['Download Dir']; } $r = client_add_torrent(str_replace('/ /', '%20', trim($_GET['link'])), $downloadDir, $_GET['title'], $_GET['feed']); if ($r == "Success") { //$torHash = get_torHash(add_cache($_GET['title'])); $torHash = get_torHash(add_cache(filter_input(INPUT_GET, 'title'))); } if (isset($torHash)) { echo $torHash; } else { echo $r; } exit(0); break; case 'clearHistory': // Loaded via ajax if (file_exists($config_values['Settings']['History'])) { unlink($config_values['Settings']['History']); } display_history(); close_html(); exit(0); break; case 'get_client': global $config_values; echo $config_values['Settings']['Client']; exit; case 'get_autodel': global $config_values; echo $config_values['Settings']['Auto-Del Seeded Torrents']; exit; case 'getDisableHideList': global $config_values; echo $config_values['Settings']['Disable Hide List']; exit; case 'checkVersion': echo checkVersion($twxa_version); exit; case 'get_dialog_data': //switch ($_GET['get_dialog_data']) { switch (filter_input(INPUT_GET, 'get_dialog_data')) { case '#favorites': display_favorites(); exit; case '#configuration': display_global_config(); exit; case '#hidelist': display_hidelist(); exit; case '#feeds': display_feeds(); exit; case '#history': display_history(); exit; case '#show_legend': display_legend(); exit; case '#clear_cache': display_clearCache(); exit; case '#show_transmission': display_transmission(); exit; default: exit; } default: //TODO check filter_input() is not false before using it $output = ""; } if (isset($output)) { if (is_array($output)) { $output = implode("
", $output); } $html_out .= str_replace("\n", "
", "
$output

Cannot move active downloads to new location

When I try to move a download (running or finished)...
Bildschirmfoto von 2021-02-20 23-40-26
...nothing happens when I press enter or when I press the "Move" button.

I get the following error in the browser console:

Uncaught ReferenceError: assignment to undeclared variable path
    moveTorrent https://mydomain.com/torrentwatch-xa/javascript/torrentwatch-xa.js:1507
    processSelected https://mydomain.com/torrentwatch-xa/javascript/torrentwatch-xa.js:1663
    onclick https://mydomain.com/torrentwatch-xa/#:1
    jQuery 5
    <anonymous> https://mydomain.com/torrentwatch-xa/javascript/twxa_event_bindings.js:83
    jQuery 8
    <anonymous> https://mydomain.com/torrentwatch-xa/javascript/twxa_event_bindings.js:67
    jQuery 13
torrentwatch-xa.js:1507:16

I'm on latest git master.

If it is not a general problem, it would be great to get a direction where I can look at.

Regards,
efelon

Great program/ Small Issues

This program is great and is the easiest for a novice like me to get set up. I tried a few other programs but now of them would configure correctly. I am going to combine a few things together.

  • Matching has files in it, that do not appear in downloaded but have been added to transmission and completed.

  • I do think that knowing what file it will download is a little confusing. I assuming it is just the favorites, but I am not 100 percent sure.

  • How often does it update the feed? I don't see any options to change that from the menu

  • A small error is that I changed my directory it keeps saying the folder does not exist, but it does work

Error messge still active although get_webDir() in config.php was changed

Hi,

Setup:
Raspbian stretch
Nginx 1.10.3 (WebDir /var/www/torrentwatch)

location /torrentwatch {
	index index.html;

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
	}
    }

PHP 7.0 (fpm)

Logs

I was not able to find any hints in nginx error logs nor in /tmp/twxalog.

Description

When I change the location to the default one

/var/www/html/torrentwatch-xa

the error disappears. It also doesn't show up, even if I change the config.php get_webDir() to return another folder.

Other than that i can't find any other issue at the moment (tested now only for ~30 minutes). I'm able to connect to a transmission instance on another machine and add a torrent.

Keep up the resurrection ;)
Regards,
Martin

Is there a way to stop full seasons to be downloaded?

Hi,

I'm on 1.0.0 from the release tags. Recently in my feeds some full season torrents show up like:

ExampleName S02 WEBRip

In this case it was a fake coming up before the full season actually was aired, stopping further downloads. Ending up setting the favorite to:

image

Another case:

Although a series favorite already states last downloaded e.g. 6x10, upcoming full seasons like S02 are downloaded regardless of the current progress of the series.

It would be really helpful to disable "full" season downloads by setting.

In general i'm very happy with the software and also successfully updated to 1.0.0 with your script.

Best regards,
Martin

Torrent links within some feeds don't get recognized

Problem

I came across this problem some time ago with the old torrentwatch-x on qnapnas where links from - I think it was kickass torrents - were not identified. Those links looked like this for example:

http://itorrents.org/torrent/42AEABA2CE6938C4C43F33FD609A9848FF4BB6F2.torrent?title=Drug-Lords-S02E02-WEB-x264-TVSLiCES

This is now also the case for limetorrents.cc (e.g. https://www.limetorrents.cc/rss/20/). They use the hash value as file name as you can see.

Solution

At that time I made a quick fix which also works for you. I tested it on limetorrents and briefly for some other feeds, so that there is no impact. Since I'm not fluent with git and github (Pull requests) and the fix is very small I hope you don't mind me putting it in here as text:

torrentwatch-xa/var/lib/torrentwatch-xa/lib/twxa_feed.php

New function:

/**
 * @brief Tries to extract a torrent hash from given URL constructs a magnet link from it
 * @param $url string
 * @return $url if no torrent SHA-1 hash string was found within $url
 * @return magnet-link containing extracted torrent hash
 */
function magnetlink_getMagnetLinkFromURL($url)
{
	$hash = preg_replace('/.*([a-fA-F0-9]{40}).*/', '$1', $url);
	if ($hash === $url)
	{
		return $url;
	}
	else
	{
		return "magnet:?xt=urn:btih:$hash";
	}
}

Changed function :

function get_torrent_link($rs) {
  $links = array();
  $link = "";
  if ((isset($rs['enclosure'])) && ($rs['enclosure']['type']=='application/x-bittorrent')) {
     $links[] = $rs['enclosure']['url'];
  } else {
     if(isset($rs['link'])) {
        $links[] = $rs['link'];
     }
     if(isset($rs['id']) && stristr($rs['id'], 'http://')) { // Atom
        $links[] = $rs['id'];
     }
	 if(isset($rs['enclosure'])) { // RSS Enclosure
        $links[] = $rs['enclosure']['url'];
     }
  }

  if (count($links)==1) {
	$link = $links[0];
	if (stristr("$link", "torcache.net") || stristr("$link", "itorrents.org")){
		$link = magnetlink_getMagnetLinkFromURL($link);
 	}
  } else if (count($links) > 0) {
	$link = choose_torrent_link($links);
  }
  $link = str_replace(" ", "%20", $link);
  return html_entity_decode($link);
}

Originally I had the function magnetlink_getMagnetLinkFromURL($url) in its own file and included it to twxa_feed.php.

A little side effect is, that immediately after a torrent is added in this way, its title only shows the hash value until the name got resolved by transmission.

Maybe you can improve this in many ways. I hope it helps anyway.

Source web page acquisition timeout too short

I've noticed (using the code from 28 Jun 2021) that I'm getting a lot of "source website is not available" messages, without any other content.

I've found that - while using a normal web browser - accessing Cloudflare hosted websites can sometimes give the "website not available" (http 503, for example) but then go on to load the content within a second or two.

I'd like to suggest you increase the timeout on whatever mechanism is pulling the target site's content to give it a chance to overcome this Cloudflare boondoggle.

Add destination path to the favorites data.

Allow specification of a destination path and pattern to the favorites database, so that matched shows can be moved directly to an archive for that specific show.

Ie

/tvarch/shows/{show}/Season {season}/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.