Added proxy.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
const config = require('config');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
const logger = require('../logger')(__filename);
|
||||
|
||||
const base = 'https://www.erome.com/';
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
const config = require('config');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
|
||||
async function eroshareAlbum(host) {
|
||||
const res = await fetch(`https://web.archive.org/web/20170630040157im_/https://eroshare.com/${host.id}`);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
|
||||
async function eroshareItem(host, post) {
|
||||
const res = await fetch(`https://web.archive.org/web/20170630040157im_/https://eroshare.com/i/${host.id}`);
|
||||
if (!res.ok) {
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
const bhttp = require('bhttp');
|
||||
|
||||
const { agentFor } = require('../proxy');
|
||||
const redgifs = require('./redgifs');
|
||||
|
||||
async function gfycat(host) {
|
||||
const res = await bhttp.get(`https://api.gfycat.com/v1/gfycats/${host.id}`);
|
||||
const infoUrl = `https://api.gfycat.com/v1/gfycats/${host.id}`;
|
||||
const res = await bhttp.get(infoUrl, { agent: agentFor(infoUrl) });
|
||||
const data = await res.body;
|
||||
|
||||
if (data.errorMessage) {
|
||||
const redirectRes = await bhttp.head(host.url, {
|
||||
followRedirects: false,
|
||||
agent: agentFor(host.url),
|
||||
});
|
||||
|
||||
if (redirectRes.statusCode === 301) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
const config = require('config');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
const logger = require('../logger')(__filename);
|
||||
const { fetchPredata } = require('./imgurImage');
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
const config = require('config');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
|
||||
async function fetchPredata() {
|
||||
const data = {
|
||||
limit: 0,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
|
||||
// the DASH manifest lists the actual audio track filename - reddit has changed this naming
|
||||
// scheme before (DASH_audio.mp4 -> /audio -> CMAF_AUDIO_128.mp4), so read it from the
|
||||
// manifest rather than guessing a hardcoded suffix off the video URL again
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
const mime = require('mime');
|
||||
// const unprint = require('unprint');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
const { version } = require('../../package.json');
|
||||
|
||||
async function fetchPredata() {
|
||||
|
||||
@@ -5,6 +5,7 @@ const UrlPattern = require('url-pattern');
|
||||
const cheerio = require('cheerio');
|
||||
const mime = require('mime-types');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
const logger = require('../logger')(__filename);
|
||||
|
||||
const pattern = new UrlPattern('https\\://(www.)vidble.com/:id(_med)(.:ext)');
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
const $ = require('cheerio');
|
||||
const mime = require('mime-types');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
|
||||
async function vidbleImage(host, post) {
|
||||
const res = await fetch(`https://vidble.com/${host.id}`);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const { fetch } = require('../proxy');
|
||||
|
||||
async function vidbleVideo(host, post) {
|
||||
const res = await fetch(`https://www.vidble.com/watch?v=${host.id}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user