Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip the resource which has undefined url. #9

Merged
merged 1 commit into from
Nov 20, 2016

Commits on Nov 19, 2016

  1. Skip the resource which has undefined url.

    + Test data
        + <http://2d-gate.org/thread-11531-1-12.html#.WDB7bnWw5QJ>
            + <http://embed.2d-gate.org/embed/dNkKYROsyi7r4XVyT9ZNGohFD34_hZV8L1mRf5J4pUdid7y_Z-r6GqQD-AVFk4KrKf-04NLDxyRDaeJ0jW4ldA/?hash=71wayqkaJB0tLYoed99xU5gJ6Ffc-NUOIoilneNYHlMYo5BTKKNL0RGvue7_yibCleNSXaolGKODLUuQ_Q4WZ4SqPpw8fb0DCe2aQnOo77c>
                + 我們正在處理這部影片,請稍後再試。; Error loading player: No playable sources found
    
    Fix this kind of error:
    
    ```
    /home/m157q/github/2dg/index.js:45
            var type = /.*\/(.*)/.exec(url.type)[1]
                                          ^
    
    TypeError: Cannot read property 'type' of undefined
        at Object.callback (/home/m157q/github/2dg/index.js:45:39)
        at Crawler._onInject
    (/home/m157q/github/2dg/node_modules/crawler/lib/crawler.js:469:13)
        at /home/m157q/github/2dg/node_modules/crawler/lib/crawler.js:458:18
        at Crawler._inject
    (/home/m157q/github/2dg/node_modules/crawler/lib/crawler.js:147:9)
        at Crawler._onContent
    (/home/m157q/github/2dg/node_modules/crawler/lib/crawler.js:457:14)
        at Request._callback
    (/home/m157q/github/2dg/node_modules/crawler/lib/crawler.js:351:18)
        at Request.self.callback
    (/home/m157q/github/2dg/node_modules/crawler/node_modules/request/request.js:236:22)
        at emitTwo (events.js:106:13)
        at Request.emit (events.js:191:7)
        at Request.<anonymous>
    (/home/m157q/github/2dg/node_modules/crawler/node_modules/request/request.js:1142:14)
    ```
    shunyi authored and shunyi committed Nov 19, 2016
    Configuration menu
    Copy the full SHA
    d440d83 View commit details
    Browse the repository at this point in the history