Coder Social home page Coder Social logo

oropensubtitledownloader's Introduction

OROpenSubtitleDownloader

An Obj-C API for Searching and Downloading Subtitles from OpenSubtitles. Currently supports only searching and downloading of srt files are support. Pull Requests with more features are welcome.

OpenSubtitles Documentation

/// OROpenSubtitleDownloader makes it easier to handle downloading and searching
/// for subtitles via the opensubtitles.org API

@interface OROpenSubtitleDownloader : NSObject <XMLRPCConnectionDelegate>

/// By using init the object will create it's own user agent based on bundle info
- (OROpenSubtitleDownloader *)init;

/// Use a custom user agent
- (OROpenSubtitleDownloader *)initWithUserAgent:(NSString *)userAgent;

/// The object that recieves notifications for new subtitles
@property (nonatomic, weak) NSObject <OROpenSubtitleDownloaderDelegate> *delegate;

/// Internal state of subtitle downloader
@property (nonatomic, readonly) OROpenSubtitleState state;

/// Language string, defaults to "eng", 
/// See: http://www.opensubtitles.org/addons/export_languages.php for full list
@property (nonatomic, strong) NSString *languageString;

/// Search and get a return block with an array of OpenSubtitleSearchResult
- (void)searchForSubtitlesWithHash:(NSString *)hash andFilesize:(NSNumber *)filesize :(void(^) (NSArray *subtitles))searchResult;

/// Downloads a subtitle result to a file after being unzipped
- (void)downloadSubtitlesForResult:(OpenSubtitleSearchResult *)result toPath:(NSString *)path :(void(^)())onResultsFound;
@end

oropensubtitledownloader's People

Contributors

igrandav avatar janc avatar javierquerol avatar orta avatar romac 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

oropensubtitledownloader's Issues

App Crashes

First of all, thank you very much for taking the time to write this piece of code, it really would save me a lot of time and nerves, if I get it running, but unfortunately I ran into something I can't seem to resolve myself. I hope you can help me out, or if you got some example code somewhere, that would also be very appreciated.

To my problem: I initiate my instance in my -applicationDidFinishLaunching: method:

OROpenSubtitleDownloader *downloader = [[OROpenSubtitleDownloader alloc] initWithUserAgent:@"OS Test User Agent"];
downloader.delegate = self;

and then in the delegate callback I try to search for downloads like that:

NSLog(@"#1");
[downloader searchForSubtitlesWithHash:hash andFilesize:fileSize :^(NSArray *subs) { NSLog(@"%@", subs); }];
NSLog(@"#2");

and it runs fine - except that it doesn't log any subtitles - until after NSLog(@"#2"); but when it exits the method it crashes somewhere, and just shows some assembly code.
I use Mac OS X 10.7.5 and Xcode 4.6.3 and my project doesn't use ARC but I set the -fobjc-arc flag for OROpenSubtitleDownloader.m.
Thanks in advance for any hints or if it's a bug, if you could just point me to the right direction?

Tests: Unit Test

Things I'd like if you're adding tests for this project:

Tooling: Specta/Expecta

Areas to look at:

  • Expecting that you get aSubtitler based on the user agent
  • Stubbing the XMLRPCConnectionDelegate and then testing that delegate calls are correctly responded to
  • With a fake connection, ensure that the OROpenSubtitleDownloader state is correct for downloading.
  • Ensuring that the correct URL is generated for a OpenSubtitleSearchResult
  • Ensuring that a OpenSubtitleSearchResult is generated from the correct NSDictionary

Notes

  • This project doesn't even have an Xcode Project, I have no problems around how this is set up.

Is tvOS supported ?

Hi,
I see that there is a merged tvOS pull request #8 but I'm getting some AFNetworking dependency errors on tvOS when using CocoaPods. Is this supposed to work?

[!] The platform of the target `MyKit` (tvOS 9.0) is not compatible with `AFNetworking (2.6.3)`, which does not support `tvos`.

cheers

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.