|
|
@ -32,7 +32,7 @@ module.exports = function createPastebinComScraper(options = {}) {
|
|
|
|
queue.define("fetchPaste", (task) => {
|
|
|
|
queue.define("fetchPaste", (task) => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
debug(`Fetching paste ID ${task.pasteKey}...`)
|
|
|
|
debug(`Fetching paste ID ${task.pasteKey}...`)
|
|
|
|
return bhttp.get(`https://pastebin.com/api_scrape_item.php?i=${task.pasteKey}`);
|
|
|
|
return bhttp.get(`https://scrape.pastebin.com/api_scrape_item.php?i=${task.pasteKey}`);
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
if (response.statusCode !== 200) {
|
|
|
|
if (response.statusCode !== 200) {
|
|
|
|
if (response.statusCode >= 500 && response.statusCode < 600) {
|
|
|
|
if (response.statusCode >= 500 && response.statusCode < 600) {
|
|
|
@ -63,7 +63,7 @@ module.exports = function createPastebinComScraper(options = {}) {
|
|
|
|
start: function startScraper() {
|
|
|
|
start: function startScraper() {
|
|
|
|
loop = promiseSetInterval(() => {
|
|
|
|
loop = promiseSetInterval(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return bhttp.get(`https://pastebin.com/api_scraping.php?limit=${defaultValue(options.listLimit, 100)}`, {
|
|
|
|
return bhttp.get(`https://scrape.pastebin.com/api_scraping.php?limit=${defaultValue(options.listLimit, 100)}`, {
|
|
|
|
noDecode: true /* Because Pastebin.com errors aren't JSON... */
|
|
|
|
noDecode: true /* Because Pastebin.com errors aren't JSON... */
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|