Git Product home page Git Product logo

sourcescraper's Introduction

SourceScraper

Build Status npm version Dependency Status DevDependency Status License Doge lerna

Scrap the sources from your favorite video streaming sites.


Supported Sites

Source

Hoster


Getting Started

Installation

$ npm i source-scraper

There is a package available for each site individually which you can find here.

Usage

const { scrapers } = require('source-scraper');

(async () => {
    const url = 'some url';
    const scraper = scrapers.all.getFirstApplicable(url);
    const scrap = await scraper.scrap(url);
    if (scrap.success)
        console.log(scrap.data);
})();

API

The API generated with TypeDoc can be found here.

sourcescraper's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sourcescraper's Issues

Vidstreaming - keeps failing

Tried on following URLS:

Usage (default):

const { VidstreamingScraper } = require('vidstreaming-scraper');
 
(async () => {
    const url = 'https://vidstreaming.io/streaming.php?id=ODI1NTk';
    const scrap = await new VidstreamingScraper().scrap(url);
    if (scrap.success) {
        console.log(scrap.data.sources);
    }else{
        console.log(scrap)
    }
})();

Result:

Scrap {
  data: undefined,
  url: 'https://vidstreaming.io/streaming.php?id=ODI1NTk',
  scraper:
   VidstreamingScraper {
     name: 'vidstreaming',
     domains: [ 'vidstreaming.io' ],
     urlPattern: /(?:(?:https?:)?\/\/)?(?:[^.]+\.)?vidstreaming\.io\/(streaming|load)\.php\?id=(\w+)=&title=([\w+]+)/i,
     runner: HtmlRunner { defaultOptions: [Object] },
     defaultOptions: {} },
  success: false,
  error: TypeError: lodash_flatmap_1.default is not a function
    at VidstreamingScraper.execWithArgs (D:\Users\robin\Websites\TestTorr\node_modules\vidstreaming-scraper\dist\VidstreamingScraper.js:34:49)
    at runner.run (D:\Users\robin\Websites\TestTorr\node_modules\source-scraper-core\dist\RunnerScraper.js:9:103)
    at HtmlRunner.exec (D:\Users\robin\Websites\TestTorr\node_modules\source-scraper-html-runner\dist\HtmlRunner.js:14:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) }

Errors when running project

I have added this into an Ionic project and am trying to run it however getting the below errors:

ERROR in ./node_modules/puppeteer/lib/Launcher.js [ng] Module not found: Error: Can't resolve 'os' in 'node_modules/puppeteer/lib' [ng] ERROR in ./node_modules/jsdom/lib/api.js [ng] Module not found: Error: Can't resolve 'path' in 'node_modules/jsdom/lib' [ng] ERROR in ./node_modules/jsdom/lib/jsdom/utils.js [ng] Module not found: Error: Can't resolve 'path' in 'node_modules/jsdom/lib/jsdom' [ng] ERROR in ./node_modules/mime-types/index.js [ng] Module not found: Error: Can't resolve 'path' in 'node_modules/mime-types' [ng] ERROR in ./node_modules/puppeteer/lib/Launcher.js [ng] Module not found: Error: Can't resolve 'path' in 'node_modules/puppeteer/lib' [ng] ERROR in ./node_modules/puppeteer/lib/ExecutionContext.js [ng] Module not found: Error: Can't resolve 'path' in 'node_modules/puppeteer/lib' [ng] ERROR in ./node_modules/assert-plus/assert.js [ng] Module not found: Error: Can't resolve 'stream' in 'node_modules/assert-plus' [ng] ERROR in ./node_modules/combined-stream/lib/combined_stream.js [ng] Module not found: Error: Can't resolve 'stream' in 'node_modules/combined-stream/lib' [ng] ERROR in ./node_modules/delayed-stream/lib/delayed_stream.js [ng] Module not found: Error: Can't resolve 'stream' in 'node_modules/delayed-stream/lib' [ng] ERROR in ./node_modules/isstream/isstream.js [ng] Module not found: Error: Can't resolve 'stream' in 'node_modules/isstream' [ng] ERROR in ./node_modules/request/request.js [ng] Module not found: Error: Can't resolve 'stream' in 'node_modules/request' [ng] ERROR in ./node_modules/sshpk/lib/ed-compat.js [ng] Module not found: Error: Can't resolve 'stream' in 'node_modules/sshpk/lib' [ng] ERROR in ./node_modules/forever-agent/index.js [ng] Module not found: Error: Can't resolve 'tls' in 'node_modules/forever-agent' [ng] ERROR in ./node_modules/tunnel-agent/index.js [ng] Module not found: Error: Can't resolve 'tls' in 'node_modules/tunnel-agent' [ng] ERROR in ./node_modules/puppeteer/lib/WebSocketTransport.js [ng] Module not found: Error: Can't resolve 'ws' in 'node_modules/puppeteer/lib' [ng] ERROR in ./node_modules/request/request.js [ng] Module not found: Error: Can't resolve 'zlib' in 'node_modules/request'

Is there something I'm missing with the install?

Cannot read property 'scrap' of undefined

nils at nilsdigital in ~/C/JavaScript
» cat test.js
const { scrapers } = require('source-scraper');

(async () => {
    const url = 'https://vidstreaming.io/videos/kaze-ga-tsuyoku-fuiteiru-episode-5';
    const scraper = scrapers.all.getFirstApplicable(url);
    const scrap = await scraper.scrap(url);
    if (scrap.success)
        console.log(scrap.data);
})();
nils at nilsdigital in ~/C/JavaScript
» node test.js
(node:6853) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'scrap' of undefined
    at /Users/nils/Code/JavaScript/test.js:6:33
    at Object.<anonymous> (/Users/nils/Code/JavaScript/test.js:9:3)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
    at startup (internal/bootstrap/node.js:303:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:872:3)
(node:6853) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6853) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Originally posted by @thistehneisen in #3 (comment)

Problem running SourceScraper

0. Hello excuse my bad coding my last Java lessons are a few years ago

1. Installing source-scraper

root@stream:~/SourceScraper# npm i source-scraper
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

2. Open node

root@stream:~/SourceScraper# sudo node

3. Running Script

root@stream:~/SourceScraper# sudo node

const { scrapers } = require('source-scraper');
Error: Cannot find module './TiwikiwiScraper'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)

(async () => {
... const url = 'some url';
... const scraper = scrapers.getFirstApplicable(url);
... const scrap = await scraper.scrap(url);
... if (scrap.success)
... console.log(scrap.data);
... })();
Promise {
ReferenceError: scrapers is not defined
at repl:3:21
at repl:7:3
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:468:10)
at emitOne (events.js:121:20)
at REPLServer.emit (events.js:211:7)
at REPLServer.Interface._onLine (readline.js:280:10),
domain:
Domain {
domain: null,
_events: { error: [Function: debugDomainError] },
_eventsCount: 1,
_maxListeners: undefined,
members: [] } }
(node:4103) UnhandledPromiseRejectionWarning: ReferenceError: scrapers is not defined
at repl:3:21
at repl:7:3
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:468:10)
at emitOne (events.js:121:20)
at REPLServer.emit (events.js:211:7)
at REPLServer.Interface._onLine (readline.js:280:10)
(node:4103) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4103) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

4. second try

root@stream:~/SourceScraper# sudo node

const { StreamcloudScraper } = require('[email protected]');
Error: Cannot find module '[email protected]'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)

undefined

(async () => { const url = 'https://streamango.com'; const scrap = await new
... StreamcloudScraper().scrap(url); if (scrap.success)
... console.log(scrap.data.sources);
... })();
Promise {
ReferenceError: StreamcloudScraper is not defined
at repl:1:68
at repl:4:3
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:468:10)
at emitOne (events.js:121:20)
at REPLServer.emit (events.js:211:7)
at REPLServer.Interface._onLine (readline.js:280:10),
domain:
Domain {
domain: null,
_events: { error: [Function: debugDomainError] },
_eventsCount: 1,
_maxListeners: undefined,
members: [] } }
(node:4123) UnhandledPromiseRejectionWarning: ReferenceError: StreamcloudScraper is not defined
at repl:1:68
at repl:4:3
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:468:10)
at emitOne (events.js:121:20)
at REPLServer.emit (events.js:211:7)
at REPLServer.Interface._onLine (readline.js:280:10)
(node:4123) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4123) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

5. Help Please

MP4Upload - Cannot read property 'map' of undefined

** Tried on:**

Usage (default):

const { MP4UploadScraper } = require('mp4upload-scraper');
 
(async () => {
    const url = 'https://mp4upload.com/embed-piy9gipghtm8.html';
    const scrap = await new MP4UploadScraper().scrap(url);
    if (scrap.success)
        console.log(scrap.data.sources);
})();

Result:

(node:19436) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'map' of undefined
(node:19436) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:19436) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
Scrap {
  data: undefined,
  url: 'https://mp4upload.com/embed-piy9gipghtm8.html',
  scraper:
   MP4UploadScraper {
     name: 'mp4upload',
     domains: [ 'mp4upload.com' ],
     urlPattern: /(?:(?:https?:)?\/\/)?(?:[^.]+\.)?mp4upload\.com\/embed-([a-zA-Z0-9]+)\.html/i,
     runner: JWPlayerRunner { defaultOptions: {} },
     defaultOptions: {} },
  success: false,
  error: TypeError: Cannot read property 'map' of undefined
    at MP4UploadScraper.execWithArgs (C:\Users\robin\Desktop\MasteranimeAP\MasteranimeAP\node_modules\source-scraper-jwplayer-runner\dist\SimpleJWPlayerScraper.js:18:30)
    at runner.run (C:\Users\robin\Desktop\MasteranimeAP\MasteranimeAP\node_modules\source-scraper-jwplayer-runner\node_modules\source-scraper-core\dist\RunnerScraper.js:9:103)
    at source_scraper_puppeteer_runner_1.PuppeteerRunner.run (C:\Users\robin\Desktop\MasteranimeAP\MasteranimeAP\node_modules\source-scraper-jwplayer-runner\dist\JWPlayerRunner.js:18:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) }

Custom Scraper

Hi everyone

How can i create a custom scrapper for Vidmoly or anyone does have ?

Thanks.

Tiwikiwi - flowplayer is not defined

** Tried on:**

Usage (default):

const { TiwikiwiScraper } = require('tiwikiwi-scraper');
 
(async () => {
    const url = 'https://tiwi.kiwi/embed-i6vz7118suj6.html';
    const scrap = await new TiwikiwiScraper().scrap(url);
    if (scrap.success) {
        console.log(scrap.data.sources);
    } else {
        console.log(scrap)
    }
})();

Result:

Scrap {
  data: undefined,
  url: 'https://tiwi.kiwi/embed-i6vz7118suj6.html',
  scraper:
   TiwikiwiScraper {
     name: 'tiwikiwi',
     domains: [ 'tiwi.kiwi' ],
     urlPattern: /(?:(?:https?:)?\/\/)?(?:[^.]+\.)?tiwi\.kiwi\/(embed-([0-9a-zA-Z]+)\.html|([0-9a-zA-Z]+))/i,
     runner: FlowplayerRunner { defaultOptions: {} },
     defaultOptions: {} },
  success: false,
  error: Error: Evaluation failed: ReferenceError: flowplayer is not defined
    at __puppeteer_evaluation_script__:1:1
    at ExecutionContext.evaluateHandle (D:\PC_Folder\Websites\API\node_modules\puppeteer\lib\ExecutionContext.js:90:15)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  -- ASYNC --
    at ExecutionContext.<anonymous> (D:\PC_Folder\Websites\API\node_modules\puppeteer\lib\helper.js:144:27)
    at Page.evaluateHandle (D:\PC_Folder\Websites\API\node_modules\puppeteer\lib\Page.js:286:20)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  -- ASYNC --
    at Page.<anonymous> (D:\PC_Folder\Websites\API\node_modules\puppeteer\lib\helper.js:144:27)
    at source_scraper_puppeteer_runner_1.PuppeteerRunner.run (D:\PC_Folder\Websites\API\node_modules\source-scraper-flowplayer-runner\dist\FlowplayerRunner.js:13:43)
    at PuppeteerRunner.exec (D:\PC_Folder\Websites\API\node_modules\source-scraper-puppeteer-runner\dist\PuppeteerRunner.js:45:26)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) }

jwplayer not defined error

I'm getting this error while scraping mp4upload from my google cloud instance error: Error: Evaluation failed: ReferenceError: jwplayer is not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.