Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ba51b7270 | ||
|
|
7da4289097 | ||
|
|
ce5038cf08 | ||
|
|
1b0f53a88c | ||
|
|
d19992f0d3 | ||
|
|
a44d1ae668 | ||
|
|
14fd18479e | ||
|
|
1106a28288 | ||
|
|
f1a5d1b6a8 | ||
|
|
4193643306 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "crunchy",
|
"name": "crunchy",
|
||||||
"version": "1.4.0",
|
"version": "1.4.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=5.0"
|
"node": ">=5.0"
|
||||||
},
|
},
|
||||||
"version": "1.4.0",
|
"version": "1.4.2",
|
||||||
"bin": {
|
"bin": {
|
||||||
"crunchy": "./bin/crunchy",
|
"crunchy": "./bin/crunchy",
|
||||||
"crunchy.sh": "./bin/crunchy.sh"
|
"crunchy.sh": "./bin/crunchy.sh"
|
||||||
|
|||||||
10
src/batch.ts
10
src/batch.ts
@@ -252,7 +252,15 @@ function checkURL(address: string): boolean
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (address.startsWith('http:\/\/'))
|
if (address.startsWith('https:\/\/'))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (address.startsWith('@http:\/\/'))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (address.startsWith('@https:\/\/'))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/cli.ts
17
src/cli.ts
@@ -8,17 +8,20 @@ const current_version = pjson.version;
|
|||||||
|
|
||||||
/* Check if the current version is the latest */
|
/* Check if the current version is the latest */
|
||||||
log.info('Crunchy version ' + current_version);
|
log.info('Crunchy version ' + current_version);
|
||||||
request.get({ uri: 'https://raw.githubusercontent.com/Godzil/Crunchy/master/package.json' },
|
request.get({ uri: 'https://box.godzil.net/getVersion.php?tool=crunchy&v=' + current_version },
|
||||||
(error: Error, response: any, body: any) =>
|
(error: Error, response: any, body: any) =>
|
||||||
{
|
{
|
||||||
const onlinepkg = JSON.parse(body);
|
const onlinepkg = JSON.parse(body);
|
||||||
let tmp = current_version.split('.');
|
if (onlinepkg.status === 'ok')
|
||||||
const cur = (Number(tmp[0]) * 10000) + (Number(tmp[1]) * 100) + Number(tmp[2]);
|
|
||||||
tmp = onlinepkg.version.split('.');
|
|
||||||
const dist = (Number(tmp[0]) * 10000) + (Number(tmp[1]) * 100) + Number(tmp[2]);
|
|
||||||
if (dist > cur)
|
|
||||||
{
|
{
|
||||||
log.warn('There is a newer version of crunchy (v' + onlinepkg.version + '), you should update!');
|
let tmp = current_version.split('.');
|
||||||
|
const cur = (Number(tmp[0]) * 10000) + (Number(tmp[1]) * 100) + Number(tmp[2]);
|
||||||
|
tmp = onlinepkg.version.split('.');
|
||||||
|
const dist = (Number(tmp[0]) * 10000) + (Number(tmp[1]) * 100) + Number(tmp[2]);
|
||||||
|
if (dist > cur)
|
||||||
|
{
|
||||||
|
log.warnMore('There is a newer version of crunchy (v' + onlinepkg.version + '), you should update!');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function fileExist(path: string)
|
|||||||
|
|
||||||
function sanitiseFileName(str: string)
|
function sanitiseFileName(str: string)
|
||||||
{
|
{
|
||||||
return str.replace(/[\/':\?\*"<>\.]/g, '_');
|
return str.replace(/[\/':\?\*"<>\\\.]/g, '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ export function warn(str: string)
|
|||||||
console.log(' \x1B[1;33m* WARN \x1B[0m: ' + str);
|
console.log(' \x1B[1;33m* WARN \x1B[0m: ' + str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function warnMore(str: string)
|
||||||
|
{
|
||||||
|
/* Do fancy output */
|
||||||
|
console.log(' \x1B[1;38;5;166m* WARN \x1B[0m: ' + str);
|
||||||
|
}
|
||||||
|
|
||||||
export function dispEpisode(name: string, status: string, addNL: boolean)
|
export function dispEpisode(name: string, status: string, addNL: boolean)
|
||||||
{
|
{
|
||||||
/* Do fancy output */
|
/* Do fancy output */
|
||||||
|
|||||||
@@ -173,6 +173,11 @@ export function eatCookies(config: IConfig)
|
|||||||
j = undefined;
|
j = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getUserAgent(): string
|
||||||
|
{
|
||||||
|
return defaultHeaders['User-Agent'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a GET request for the resource.
|
* Performs a GET request for the resource.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -215,9 +215,16 @@ function pageScrape(config: IConfig, task: IConfigTask, done: (err: any, result?
|
|||||||
log.info('Checking availability for ' + title);
|
log.info('Checking availability for ' + title);
|
||||||
const episodes: ISeriesEpisode[] = [];
|
const episodes: ISeriesEpisode[] = [];
|
||||||
|
|
||||||
if ($('.availability-notes-low').length || $('.availability-notes-high').length)
|
if ($('.availability-notes-low').length)
|
||||||
{
|
{
|
||||||
log.warn('This serie may have georestriction and some missings episode.');
|
log.warn('This serie may have georestriction and some missings episode (like some dubs)' +
|
||||||
|
' [Message: ' + $('.availability-notes-low').text() + '].');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('.availability-notes-high').length)
|
||||||
|
{
|
||||||
|
log.warnMore('This serie probably have georestriction and will miss some episodes' +
|
||||||
|
' [Message: ' + $('.availability-notes-high').text() + '].');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.episode').each((i, el) => {
|
$('.episode').each((i, el) => {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import childProcess = require('child_process');
|
|||||||
import os = require('os');
|
import os = require('os');
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
|
|
||||||
|
import my_request = require('../my_request');
|
||||||
import log = require('../log');
|
import log = require('../log');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,7 +25,8 @@ export default function(rtmpUrl: string, rtmpInputPath: string, swfUrl: string,
|
|||||||
else if (mode === 'HLS')
|
else if (mode === 'HLS')
|
||||||
{
|
{
|
||||||
cmd = command('ffmpeg') + ' ' +
|
cmd = command('ffmpeg') + ' ' +
|
||||||
'-y -xerror ' +
|
'-user_agent "' + my_request.getUserAgent() + '" ' +
|
||||||
|
'-y -xerror -discard none ' +
|
||||||
'-i "' + rtmpInputPath + '" ' +
|
'-i "' + rtmpInputPath + '" ' +
|
||||||
'-c copy -bsf:a aac_adtstoasc ' +
|
'-c copy -bsf:a aac_adtstoasc ' +
|
||||||
'"' + filePath + '.mp4"';
|
'"' + filePath + '.mp4"';
|
||||||
|
|||||||
Reference in New Issue
Block a user