10 Commits

Author SHA1 Message Date
Godzil
0ba51b7270 1.4.2 2018-08-05 11:01:03 +01:00
Godzil
7da4289097 1.4.2-0 2018-08-05 10:57:09 +01:00
Godzil
ce5038cf08 @ URL was broken since 1.3.7 doh! 2018-08-05 10:46:27 +01:00
Godzil
1b0f53a88c 1.4.1 2018-08-05 10:34:00 +01:00
Godzil
d19992f0d3 Make linter happy (and fix a mistake) 2018-08-05 10:30:22 +01:00
Godzil
a44d1ae668 Use a more stable and futur proof URL to get current version information 2018-08-05 09:30:14 +01:00
Godzil
14fd18479e Try to tweak ffmpeg setting, but there are still some stalling issues.. 2018-08-05 09:29:39 +01:00
Godzil
1106a28288 Make possible georestrictions messages more clear 2018-08-05 09:28:53 +01:00
Godzil
f1a5d1b6a8 Add a new warning type (more "strong" but still a warning) 2018-08-05 09:28:28 +01:00
Godzil
4193643306 Fix a missing invalid char for filename for windows ('\') 2018-08-05 09:27:46 +01:00
9 changed files with 45 additions and 14 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "crunchy",
"version": "1.4.0",
"version": "1.4.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -15,7 +15,7 @@
"engines": {
"node": ">=5.0"
},
"version": "1.4.0",
"version": "1.4.2",
"bin": {
"crunchy": "./bin/crunchy",
"crunchy.sh": "./bin/crunchy.sh"

View File

@@ -252,7 +252,15 @@ function checkURL(address: string): boolean
{
return true;
}
if (address.startsWith('http:\/\/'))
if (address.startsWith('https:\/\/'))
{
return true;
}
if (address.startsWith('@http:\/\/'))
{
return true;
}
if (address.startsWith('@https:\/\/'))
{
return true;
}

View File

@@ -8,17 +8,20 @@ const current_version = pjson.version;
/* Check if the current version is the latest */
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) =>
{
const onlinepkg = JSON.parse(body);
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)
if (onlinepkg.status === 'ok')
{
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!');
}
}
});

View File

@@ -66,7 +66,7 @@ function fileExist(path: string)
function sanitiseFileName(str: string)
{
return str.replace(/[\/':\?\*"<>\.]/g, '_');
return str.replace(/[\/':\?\*"<>\\\.]/g, '_');
}
/**

View File

@@ -26,6 +26,12 @@ export function warn(str: string)
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)
{
/* Do fancy output */

View File

@@ -173,6 +173,11 @@ export function eatCookies(config: IConfig)
j = undefined;
}
export function getUserAgent(): string
{
return defaultHeaders['User-Agent'];
}
/**
* Performs a GET request for the resource.
*/

View File

@@ -215,9 +215,16 @@ function pageScrape(config: IConfig, task: IConfigTask, done: (err: any, result?
log.info('Checking availability for ' + title);
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) => {

View File

@@ -3,6 +3,7 @@ import childProcess = require('child_process');
import os = require('os');
import path = require('path');
import my_request = require('../my_request');
import log = require('../log');
/**
@@ -24,7 +25,8 @@ export default function(rtmpUrl: string, rtmpInputPath: string, swfUrl: string,
else if (mode === 'HLS')
{
cmd = command('ffmpeg') + ' ' +
'-y -xerror ' +
'-user_agent "' + my_request.getUserAgent() + '" ' +
'-y -xerror -discard none ' +
'-i "' + rtmpInputPath + '" ' +
'-c copy -bsf:a aac_adtstoasc ' +
'"' + filePath + '.mp4"';