Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: victorpimentel/TVShows
base: 41d3a6d94d
...
head fork: victorpimentel/TVShows
compare: c47cd1bec0
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
2  Classes/AppInfoConstants.h
@@ -19,7 +19,7 @@
#define TVShowsHelperDomain @"com.victorpimentel.TVShowsHelper"
#define TVShowsWebsite @"http://tvshowsapp.com/"
-#define TVShowsSupport @"http://support.tvshowsapp.com/discussion/new"
+#define TVShowsSupport @"http://support.tvshowsapp.com/"
#define TVShowsBlog @"http://blog.tvshowsapp.com/"
#define TVShowsTwitter @"http://twitter.com/TVShows2/"
#define TVShowsDonations @"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2PARRGESKRQJ6&item_name=TVShows2&item_number=TVShows2&currency_code=%@&lc=%@&bn=PP%%2dDonationsBF%%3abtn_donateCC_LG%%2egif%%3aNonHosted"
View
1  Classes/TSRegexFun.h
@@ -24,6 +24,7 @@
+ (BOOL) isEpisodeHD:(NSString *)title;
+ (NSString *) parseTitleFromString:(NSString *)title withIdentifier:(NSArray* )identifier withType:(NSString *)type;
+ (NSString *) parseShowFromTitle:(NSString *)title;
++ (NSString *) parseHashFromMagnetLink:(NSString *)aMagnetLink;
+ (NSString *) replaceHTMLEntitiesInString:(NSString *)string;
+ (BOOL) wasThisEpisode:(NSString *)anEpisode airedAfterThisOne:(NSString *)anotherEpisode;
View
11 Classes/TSRegexFun.m
@@ -57,7 +57,7 @@ + (NSString *) removeLeadingZero:(NSString *)string
+ (BOOL) isEpisodeHD:(NSString *)title
{
- return [title isMatchedByRegex:@"(720|1080|HR|x264|mkv)"];
+ return [title isMatchedByRegex:@"(720|1080)"];
}
+ (NSString *) parseTitleFromString:(NSString *)title withIdentifier:(NSArray* )identifier withType:(NSString *)type
@@ -112,6 +112,15 @@ + (NSString *) parseShowFromTitle:(NSString *)title
return showTitle;
}
++ (NSString *) parseHashFromMagnetLink:(NSString *)aMagnetLink
+{
+ NSString *magnetHash = [aMagnetLink stringByReplacingOccurrencesOfRegex:@"^.*btih:" withString:@""];
+
+ magnetHash = [magnetHash stringByReplacingOccurrencesOfRegex:@"[^a-fA-F0-9].*$" withString:@""];
+
+ return magnetHash;
+}
+
+ (NSString *) replaceHTMLEntitiesInString:(NSString *)string
{
string = [string stringByReplacingOccurrencesOfRegex:@"&" withString:@"&"];
View
2  Classes/TSTorrentFunctions.h
@@ -22,5 +22,7 @@
+ (BOOL) downloadEpisode:(NSObject *)episode ofShow:(NSObject *)show;
+ (BOOL) shouldDownloadSDForEpisode:(NSString *)episodeName;
+ (NSString *) saveLocationForEpisode:(NSObject *)episode ofShow:(NSString *)showName;
++ (NSString *) getTorrentFileFromMagnetLink:(NSString *)aMagnetLink;
++ (NSString *) getTorrentFileFromMagnetHash:(NSString *)aMagnetHash;
@end
View
12 Classes/TSTorrentFunctions.m
@@ -256,4 +256,16 @@ + (NSString *) saveLocationForEpisode:(NSObject *)episode ofShow:(NSString *)sho
return saveLocation;
}
++ (NSString *) getTorrentFileFromMagnetLink:(NSString *)aMagnetLink
+{
+ NSString *magnetHash = [TSRegexFun parseHashFromMagnetLink:aMagnetLink];
+
+ return [TSTorrentFunctions getTorrentFileFromMagnetHash:magnetHash];
+}
+
++ (NSString *) getTorrentFileFromMagnetHash:(NSString *)aMagnetHash
+{
+ return [NSString stringWithFormat:@"https://torcache.net/torrent/%@.torrent", aMagnetHash];
+}
+
@end
View
2  Classes/TVShowsPref.m
@@ -68,7 +68,7 @@ - (void) didSelect
// If The Pirate Bay seems blocked, set the magnets option
if ([WebsiteFunctions canConnectToURL:@"http://www.google.com"] &&
- ![WebsiteFunctions canConnectToURL:@"http://thepiratebay.org"]) {
+ ![WebsiteFunctions canConnectToURL:@"http://thepiratebay.se"]) {
[TSUserDefaults setKey:@"PreferMagnets" fromBool:YES];
}
View
1  Classes/TorrentzParser/TorrentzParser.h
@@ -21,5 +21,6 @@
+ (NSString *) getAlternateTorrentForEpisode:(NSString *)anEpisode;
+ (NSArray *) getAllTorrentsFromTorrenzURL:(NSString *)aTorrentzURL;
+ (NSString *) getTorrentFromTracker:(NSString*)theBaseURL withLinkMatcher:(NSString*)theLinkMatcher appending:(NSString*)aString;
++ (NSString *) getHashFromTorrentzURL:(NSString*)theURL;
@end
View
35 Classes/TorrentzParser/TorrentzParser.m
@@ -16,6 +16,7 @@
#import "TorrentzParser.h"
#import "RegexKitLite.h"
#import "WebsiteFunctions.h"
+#import "TSTorrentFunctions.h"
@implementation TorrentzParser
@@ -36,9 +37,9 @@ + (NSString *) getAlternateTorrentForEpisode:(NSString *)episodeName
// Because I'm lazy, this piece of code will be useless in 2020
// Sorry late nights viewers from the next decade
if ([episodeName rangeOfString:@" 201"].location == NSNotFound) {
- torrentzURLFormat = @"http://torrentz.eu/feed_any?q=%@+720p";
+ torrentzURLFormat = @"http://torrentz.eu/feed?q=%@+720p";
} else {
- torrentzURLFormat = @"http://torrentz.eu/feed_any?q=%%22%@%%22+720p";
+ torrentzURLFormat = @"http://torrentz.eu/feed?q=%%22%@%%22+720p";
}
// Now let's grab the search results
@@ -88,26 +89,21 @@ + (NSArray *) getAllTorrentsFromTorrenzURL:(NSString *)aTorrentzURL
NSString *torrent = nil;
// Process only known trackers
- if([tracker hasPrefix:@"http://www.vertor.com"]) {
+ if ([tracker hasPrefix:@"http://www.vertor.com"]) {
torrent = [TorrentzParser getTorrentFromTracker:tracker
withLinkMatcher:@"http://www.vertor.com/([^\"]*)mod=download([^\"]*)id=([^\"]*)"
appending:@""];
torrent = [torrent stringByReplacingOccurrencesOfString:@"amp;" withString:@""];
- } else if([tracker hasPrefix:@"http://thepiratebay.org"]) {
- torrent = [TorrentzParser getTorrentFromTracker:tracker
- withLinkMatcher:@"http://torrents.thepiratebay.org([^\"]*)"
- appending:@""];
- } else if([tracker hasPrefix:@"http://btjunkie.org"]) {
+ } else if ([tracker hasPrefix:@"http://btjunkie.org"]) {
torrent = [TorrentzParser getTorrentFromTracker:tracker
withLinkMatcher:@"http://dl.btjunkie.org/torrent/([^\"]*)\\.torrent"
appending:@""];
- } else if([tracker hasPrefix:@"http://www.btmon.com"]) {
+ } else if ([tracker hasPrefix:@"http://www.btmon.com"]) {
torrent = [tracker stringByReplacingOccurrencesOfString:@".html" withString:@""];
-// Not trustworthy enough
-// } else if([tracker hasPrefix:@"http://www.torrenthound.com"]) {
-// torrent = [TorrentzParser getTorrentFromTracker:tracker
-// withLinkMatcher:@"/torrent/([^\"]*)"
-// appending:@"http://www.torrenthound.com"];
+ } else if ([tracker hasPrefix:@"http://www.torrenthound.com"]) {
+ torrent = [TorrentzParser getTorrentFromTracker:tracker
+ withLinkMatcher:@"/torrent/([^\"]*)"
+ appending:@"http://www.torrenthound.com"];
}
if (torrent != nil) {
@@ -115,6 +111,10 @@ + (NSArray *) getAllTorrentsFromTorrenzURL:(NSString *)aTorrentzURL
}
}
+ // Anyway, add torcache link as a backup plan
+ NSString *magnetHash = [TorrentzParser getHashFromTorrentzURL:aTorrentzURL];
+ [torrents addObject:[TSTorrentFunctions getTorrentFileFromMagnetHash:magnetHash]];
+
return torrents;
}
@@ -134,6 +134,13 @@ + (NSString *) getTorrentFromTracker:(NSString*)theURL withLinkMatcher:(NSString
}
}
++ (NSString *) getHashFromTorrentzURL:(NSString*)theURL
+{
+ NSString *magnetHash = [theURL stringByReplacingOccurrencesOfRegex:@".*torrentz.eu/" withString:@""];
+
+ return magnetHash;
+}
+
- (void)dealloc
{
[super dealloc];
View
4 Resources/en.lproj/Localizable.strings
@@ -242,7 +242,7 @@
"Send Growl notifications when…" = "Send Growl notifications when…";
-"No actual videos are downloaded by TVShows, only torrents which will require other programs to use. It is up to you, the user, to decide the legality of using any of the files downloaded by this application, in accordance with applicable copyright laws of you country." = "No actual videos are downloaded by TVShows, only torrents which will require other programs to use. It is up to you, the user, to decide the legality of using any of the files downloaded by this application, in accordance with applicable copyright laws of you country.";
+"No actual videos are downloaded by TVShows, only torrents which will require other programs to use. It is up to you, the user, to decide the legality of using any of the files downloaded by this application, in accordance with applicable copyright laws of you country." = "No actual videos are downloaded by TVShows, only torrents which will require other programs to use. It is up to you, the user, to decide the legality of using any of the files downloaded by this application, in accordance with applicable copyright laws of your country.";
"Status" = "Status";
@@ -341,4 +341,4 @@
"Your subscriptions will be backed up in the cloud and they can be synced between different computers." = "Your subscriptions will be backed up in the cloud and they can be synced between different computers.";
-"Your TVShows subscriptions will be automatically synced with your followed shows on Miso. Only airings shows known by TVShows will be synced." = "Your TVShows subscriptions will be automatically synced with your followed shows on Miso. Only airings shows known by TVShows will be synced.";
+"Your TVShows subscriptions will be automatically synced with your followed shows on Miso. Only airings shows known by TVShows will be synced." = "Your TVShows subscriptions will be automatically synced with your followed shows on Miso. Only airings shows known by TVShows will be synced.";

No commit comments for this range

Something went wrong with that request. Please try again.