Comparing version 0.0.2 to 0.0.3
23
index.js
@@ -61,7 +61,13 @@ var request = require('request'); | ||
var list = []; | ||
var result = { | ||
id: showId, | ||
episodes: [] | ||
}; | ||
var $ = cheerio.load(body); | ||
var $elements = $("table.forum_header_noborder tr[name=hover]"); | ||
$elements.each(function(i, e) { | ||
result.title = $("td.section_post_header").eq(0).find("b").text(); | ||
var $episodes = $("table.forum_header_noborder tr[name=hover]"); | ||
$episodes.each(function(i, e) { | ||
var episode = {}; | ||
@@ -74,3 +80,3 @@ | ||
episode.title = $(e).find("td").eq(1).find("a").text(); | ||
var titleRegex = episode.title.match(/(.+) S?(\d+)[Ex](\d+)(.*)/); | ||
var titleRegex = episode.title.match(/(.+) s?(\d+)[ex](\d+)(e(\d+))?(.*)/i); | ||
if (titleRegex) { | ||
@@ -80,3 +86,6 @@ episode.show = titleRegex[1]; | ||
episode.episodeNumber = parseInt(titleRegex[3]); | ||
episode.extra = titleRegex[4].trim(); | ||
episode.episodeNumber2 = parseInt(titleRegex[5]); | ||
episode.extra = titleRegex[6].trim(); | ||
episode.proper = episode.extra.toLowerCase().indexOf("proper") >= 0; | ||
episode.repack = episode.extra.toLowerCase().indexOf("repack") >= 0; | ||
} | ||
@@ -90,7 +99,7 @@ else { | ||
list.push(episode); | ||
result.episodes.push(episode); | ||
}); | ||
if (callback) callback(null, list); | ||
if (callback) callback(null, result); | ||
@@ -97,0 +106,0 @@ } |
{ | ||
"name": "eztv", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "EZTV API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -66,10 +66,22 @@ eztv | ||
Each result is an object: | ||
**Returns:** | ||
```js | ||
{ | ||
episodes: [...], | ||
id: 23, | ||
title: "The Big Bang Theory" } | ||
``` | ||
Each episode is an object: | ||
```js | ||
{ | ||
episodeNumber: 17, | ||
episodeNumber2: null, | ||
extra: "HDTV x264-LOL", | ||
id: 52823, | ||
magnet: "magnet:?xt=urn:btih:64DZYZWMUAVLIWJUXGDIK4QGAAIN7SL6&dn=The.Big.Bang.Theory.S07E17.HDTV.x264-LOL&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.publicbt.com:80&tr=udp://tracker.istole.it:80&tr=udp://open.demonii.com:80&tr=udp://tracker.coppersurfer.tk:80", | ||
proper: false, | ||
repack: false, | ||
seasonNumber: 7, | ||
@@ -76,0 +88,0 @@ show: "The Big Bang Theory", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6404
79
93