Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jps

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jps - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

56

lib/scraper.js
(function() {
var $, bitrates, ent, f, formats, getTorrents, markOld, medias, parseArtist, parseDate, parseRelease, parseTorrentInfo, parseTorrents, request, torrentRegex, url;
url = require('url');
request = require('request');
$ = require('jq').jQuery;
$ = require('jquery');
ent = require('ent');
f = require('f');
getTorrents = function(options, callback) {
var query, _ref;
if (options == null) {
options = {};
}
if (options == null) options = {};
query = options.query ? '?' + options.query : '';
options.uri = 'http://jpopsuki.eu/torrents.php' + query;
if ((_ref = options.headers) == null) {
options.headers = {};
}
if ((_ref = options.headers) == null) options.headers = {};
options.headers.Cookie = options.cookie;
return request(options, function(err, res, body) {
if (err) {
return callback(err);
}
if (err) return callback(err);
if (res.statusCode !== 200) {

@@ -29,17 +29,12 @@ return callback(new Error('Response Error: ' + res.statusCode));

};
markOld = function(options, callback) {
var _ref;
if (options == null) {
options = {};
}
if (options == null) options = {};
options.uri = 'http://jpopsuki.eu/torrents.php?action=markold';
if ((_ref = options.headers) == null) {
options.headers = {};
}
if ((_ref = options.headers) == null) options.headers = {};
options.headers.Cookie = options.cookie;
return request(options, function(err, res, body) {
var table;
if (err) {
return callback(err);
}
if (err) return callback(err);
if (res.statusCode !== 200) {

@@ -49,14 +44,11 @@ return callback(new Error('Response Error: ' + res.statusCode));

table = $('table#torrent_table', body);
if (table.length === 0) {
return callback(new Error('Unable to log in!'));
}
if (table.length === 0) return callback(new Error('Unable to log in!'));
return callback(null);
});
};
parseTorrents = function(body, callback) {
var last, table, torrents;
table = $('table#torrent_table', body);
if (table.length === 0) {
return callback(new Error('Unable to log in!'));
}
if (table.length === 0) return callback(new Error('Unable to log in!'));
last = null;

@@ -103,8 +95,7 @@ torrents = [];

};
parseArtist = function(a) {
var parsedHref, rs;
parsedHref = url.parse(ent.decode(a.attr('href')), true);
if (parsedHref.pathname !== 'artist.php') {
return null;
}
if (parsedHref.pathname !== 'artist.php') return null;
rs = /^(.+)?( \(View Artist\))|(View Artist)$/.exec(a.attr('title'));

@@ -117,2 +108,3 @@ return {

};
parseRelease = function(id, a, tds, single) {

@@ -158,2 +150,3 @@ var comments, data, date, orgtitle, regex, rs, str, tags, td3split, title;

};
parseDate = function(title, date) {

@@ -165,6 +158,11 @@ var regex, rs;

};
formats = ['MP3', 'FLAC', 'TAK', 'TTA', 'ALAC', 'Ogg Orbis', 'APE', 'AAC', 'WMA', 'AC3', 'WavPack', 'DTS', 'IMG', 'ISO', 'VOB', 'MPEG', 'MPEG2', 'AVI', 'MKV', 'WMV', 'MP4', 'h264', 'Ogg', 'WAV'].join('|');
bitrates = ['192', 'V2 \\(VBR\\)', 'V1 \\(VBR\\)', '256', 'V0 \\(VBR\\)', '320', 'Lossless', 'Variable', 'Other'].join('|');
medias = ['CD', 'DVD', 'Blu-Ray', 'VHS', 'VCD', 'TV', 'HDTV', 'Radio', 'Vinyl', 'WEB'].join('|');
torrentRegex = new RegExp('(' + formats + ')( \/ (' + bitrates + '))?( \/ (' + medias + '))?( \/ (.+))?( \/ Freeleech!)?');
parseTorrentInfo = function(id, str, tds, single) {

@@ -196,2 +194,3 @@ var filetype, freeleech, n, quality, reissue, rs, source;

};
module.exports = {

@@ -220,2 +219,3 @@ getTorrents: getTorrents,

};
}).call(this);
{
"name": "jps",
"description": "A scraper for the jpopsuki torrent tracker",
"version": "0.0.4",
"version": "0.0.5",
"repository": {

@@ -11,2 +11,5 @@ "type": "git",

"main": "./lib/scraper.js",
"scripts": {
"test": "vows test/test.js --spec"
},
"engines": {

@@ -16,4 +19,4 @@ "node": "*"

"dependencies": {
"request": ">=2.1.1",
"jq": ">=1.2.2",
"request": "=2.1.1",
"jquery": ">=1.6.0",
"ent": ">=0.0.4",

@@ -20,0 +23,0 @@ "f": ">=0.0.1"

@@ -1,7 +0,1 @@

Install
------------
npm install jps
Usage

@@ -87,1 +81,16 @@ ------------------

Returns the link to a torrent's download. Excluding the `authkey` and `torrent_pass` fields in the url.
Install
------------
npm install jps
Tests
---------
Tests are written with [vows](http://vowsjs.org/)
```bash
npm test
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc