Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download video
- ✓ Should be pipeable and data equal to stored file (109ms)
- ✓ Fals gracefully if error getting info
- destroy stream
- immediately
- ✓ Doesn't start the download
- right after request is made
- ✓ Doesn't start the download
- after download has started
- ✓ Download is incomplete
- stream disconnects before end
- ✓ Still downloads the whole video (45ms)
- with range
- ✓ Downloads from the given `start` to `end`
- Stream keeps disconnecting
- ✓ Too many reconnects
- with range
- ✓ Range added to download URL
- with begin
- ✓ Begin added to download URL
- with a bad filter
- ✓ Emits error
- that is broadcasted live
- ✓ Begins downloading video succesfully
- ytdl.getInfo()
- From a regular video
- ✓ Retrieves correct metainfo
- Use `ytdl.downloadFromInfo()`
- ✓ Retrives video file
- Pass request options
- ✓ Request gets called with more headers
- Using the promise API
- ✓ Retrieves correct metainfo
- On a video that fails
- ✓ Error is catched
- From a non-existant video
- ✓ Should give an error
- From an age restricted video
- ✓ Returns correct video metainfo
- In any language
- ✓ Returns correct video metainfo
- From a video that was live streamed
- ✓ Returns correct video metainfo
- From a rental
- ✓ Returns an error about it
- From a video that is not yet available
- ✓ Returns an error
- With a bad video ID
- ✓ Returns an error
- When there is an error requesting one of the pages
- ✓ Fails gracefully when unable to get watch page
- ✓ Fails gracefully when unable to find config
- ✓ Fails gracefully when unable to parse config
- ✓ Fails gracefully when unable to get embed page
- ✓ Fails gracefully when unable to get video info page
- ✓ Fails gracefully when get video info page errors
- ✓ Fails gracefully when unable to get html5player tokens
- ✓ Fails gracefully when unable to get m3u8 playlist
- ✓ Fails gracefully when no formats are found
- ✓ Fails gracefully when unable to parse player_response
- When encountering a format not yet known with debug
- ✓ Warns the console
- Try downloading videos without mocking
- Regular video
- 1) Request status code is not 403 Forbidden
- VEVO
- 2) Request status code is not 403 Forbidden
- VEVO 2
- 3) Request status code is not 403 Forbidden
- Age restricted VEVO
- 4) Request status code is not 403 Forbidden
- Age restricted
- 5) Request status code is not 403 Forbidden
- Age restricted 2
- 6) Request status code is not 403 Forbidden
- Embed domain restricted
- 7) Request status code is not 403 Forbidden
- No embed allowed
- 8) Request status code is not 403 Forbidden
- Get tokens
- ✓ Returns a set of tokens
- Hit the same video twice
- ✓ Gets html5player tokens from cache
- Get a bad html5player file
- ✓ Gives an error
- Unable to find key in filename
- ✓ Warns the console, still attempts to get tokens
- Unable to find tokens
- ✓ Gives an error
- Signature decipher
- extract deciphering actions
- ✓ Returns the correct set of actions (60ms)
- properly apply actions based on tokens
- ✓ reverses
- ✓ swaps head and position
- ✓ slices
- ✓ real set of tokens
- Set download URL
- ✓ Adds signature to download URL
- With a badly formatted URL
- ✓ Does not set URL
- With debug on
- ✓ Logs to console
- Without a URL
- ✓ Does not set URL
- With debug on
- ✓ Logs to console
- util.parseTime()
- ✓ Returns milliseconds if given numbers
- ✓ Works with minutes and seconds
- ✓ And even only hours and milliseconds
- util.sortFormats()
- With `highest` given
- ✓ Sorts available formats from highest to lowest quality
- util.chooseFormat
- ✓ Is exposed in module
- with no options
- ✓ Chooses highest quality
- With lowest quality wanted
- ✓ Chooses lowest itag
- With highest audio quality wanted
- ✓ Chooses highest audio itag
- With highest video quality wanted
- ✓ Chooses highest video itag
- With itag given
- ✓ Chooses matching format
- that is not in the format list
- ✓ Returns an error
- With list of itags given
- ✓ Chooses matching format
- With format object given
- ✓ Chooses given format without searching
- With filter given
- that matches a format
- ✓ Chooses a format
- that does not match a format
- ✓ Returns an error
- util.filterFormats
- ✓ Tries to find formats that match
- ✓ Is exposed in module
- that doesn't match any format
- ✓ Returns an empty list
- With `video` given
- ✓ Returns only matching formats
- With `videoonly` given
- ✓ Returns only matching formats
- With `audio` given
- ✓ Returns only matching formats
- With `audioonly` given
- ✓ Returns only matching formats
- With `audioandvideo` given
- ✓ Returns only matching formats
- With unsupported filter given
- ✓ Returns only matching formats
- util.between()
- ✓ `left` positioned at the start
- ✓ somewhere in the middle
- ✓ not found
- ✓ `right` before `left`
- ✓ `right` not found
- util.getURLVideoID()
- ✓ Is exposed in module
- ✓ Retrives the video ID from the url
- util.getVideoID()
- ✓ Is exposed in module
- ✓ Retrives the video ID from the url
- util.validateID()
- ✓ Is exposed in module
- ✓ Retrieves whether a string includes a video ID
- util.validateURL()
- ✓ Is exposed in module
- ✓ Retrieves whether a string includes a parsable video ID
- util.parseFormats()
- ✓ Retrieves video formats from info
- util.getVideoDescription()
- ✓ Retrieves formatted video description
- ✓ Fallbacks to empty description if element not found
- util.getAuthor()
- ✓ Returns video author object
- ✓ Returns empty object if author not found
- util.getPublished()
- ✓ Retrieves formatted published date
- util.getRelatedVideos()
- ✓ Returns related videos
- ✓ Returns empty array when error parsing
- util.parallel()
- Multiple asynchronous functions
- ✓ Calls callback with results
- where one of them errors
- ✓ Gives an error
- Zero functions
- ✓ Still calls callback
- call callback twice
- ✓ Only calls final callback once
- util.fromHumanTime
- ✓ Time format 00:00:00.000
- ✓ Time format 0ms, 0s, 0m, 0h
- ✓ No format
- 102 passing (2m)
- 8 failing
- 1) Try downloading videos without mocking
- Regular video
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
- 2) Try downloading videos without mocking
- VEVO
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
- 3) Try downloading videos without mocking
- VEVO 2
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
- 4) Try downloading videos without mocking
- Age restricted VEVO
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
- 5) Try downloading videos without mocking
- Age restricted
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
- 6) Try downloading videos without mocking
- Age restricted 2
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
- 7) Try downloading videos without mocking
- Embed domain restricted
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
- 8) Try downloading videos without mocking
- No embed allowed
- Request status code is not 403 Forbidden:
- Error: Timeout of 16000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement