Skip to content

Commit

Permalink
Make sure a signature is present to ensure accurate error reporting
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
0xced committed Aug 9, 2013
1 parent ba452f4 commit 1f0559e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ - (NSURL *) videoURLWithData:(NSData *)data error:(NSError **)error
NSDictionary *stream = DictionaryWithQueryString(streamQuery, queryEncoding);
NSString *type = stream[@"type"];
NSString *urlString = stream[@"url"];
if (urlString && [AVURLAsset isPlayableExtendedMIMEType:type])
NSString *signature = stream[@"sig"];
if (urlString && signature && [AVURLAsset isPlayableExtendedMIMEType:type])
{
NSURL *streamURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@&signature=%@", urlString, stream[@"sig"]]];
NSURL *streamURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@&signature=%@", urlString, signature]];
streamURLs[@([stream[@"itag"] integerValue])] = streamURL;
}
}
Expand Down

0 comments on commit 1f0559e

Please sign in to comment.