diff --git a/packages/metascraper-amazon/index.js b/packages/metascraper-amazon/index.js index d83aaef1f..a56a047af 100644 --- a/packages/metascraper-amazon/index.js +++ b/packages/metascraper-amazon/index.js @@ -1,6 +1,6 @@ 'use strict' -const { getUrl, getValue, titleize, isUrl } = require('@metascraper/helpers') +const { url: urlFn, $filter, titleize } = require('@metascraper/helpers') const { URL } = require('url') const { chain } = require('lodash') @@ -8,29 +8,28 @@ const REGEX_AMAZON_URL = /https?:\/\/(.*amazon\..*\/.*|.*amzn\..*\/.*|.*a\.co\/. const isAmazonUrl = url => REGEX_AMAZON_URL.test(url) const SUFFIX_LANGUAGES = { - 'ca': 'en', - 'cn': 'zh', + ca: 'en', + cn: 'zh', 'co.jp': 'ja', 'co.uk': 'en', 'com.mx': 'es', - 'com': 'en', - 'de': 'de', - 'es': 'es', - 'fr': 'fr', - 'in': 'en', - 'it': 'it' + com: 'en', + de: 'de', + es: 'es', + fr: 'fr', + in: 'en', + it: 'it' } -const getSuffix = host => chain(host) - .replace('www.', '') - .split('.') - .tail() - .join('.') - .value() +const getSuffix = host => + chain(host) + .replace('www.', '') + .split('.') + .tail() + .join('.') + .value() -const getDomainLanguage = url => ( - SUFFIX_LANGUAGES[getSuffix(new URL(url).host)] -) +const getDomainLanguage = url => SUFFIX_LANGUAGES[getSuffix(new URL(url).host)] const createWrap = fn => rule => ({ htmlDom, url }) => { const value = isAmazonUrl(url) && rule(htmlDom) @@ -38,10 +37,12 @@ const createWrap = fn => rule => ({ htmlDom, url }) => { } const wrap = createWrap((url, value) => value) -const wrapUrl = createWrap((url, value) => isUrl(value) && getUrl(url, value)) +const wrapUrl = createWrap((url, value) => urlFn(value, { url })) module.exports = () => ({ - lang: [({ htmlDom: $, meta, url }) => isAmazonUrl(url) && getDomainLanguage(url)], + lang: [ + ({ htmlDom: $, meta, url }) => isAmazonUrl(url) && getDomainLanguage(url) + ], author: [ wrap($ => titleize($('.contributorNameID').text())), wrap($ => titleize($('#bylineInfo').text())), @@ -50,7 +51,7 @@ module.exports = () => ({ title: [ wrap($ => titleize($('#productTitle').text())), wrap($ => titleize($('#btAsinTitle').text())), - wrap($ => titleize(getValue($, $('h1.a-size-large')))), + wrap($ => titleize($filter($, $('h1.a-size-large')))), wrap($ => titleize($('#item_name').text())) ], publisher: [wrap($ => 'Amazon')], diff --git a/packages/metascraper-amazon/test/index.js b/packages/metascraper-amazon/test/index.js index 00fcc5168..1279a5cf8 100644 --- a/packages/metascraper-amazon/test/index.js +++ b/packages/metascraper-amazon/test/index.js @@ -10,7 +10,7 @@ const fs = require('fs') const readFile = promisify(fs.readFile) const metascraper = require('metascraper')([ - require('metascraper-amazon')(), + require('..')(), require('metascraper-author')(), require('metascraper-date')(), require('metascraper-description')(), @@ -30,8 +30,8 @@ describe('metascraper-amazon', () => { ) const url = 'https://www.amazon.co.uk/Vegetable-Perfection-tasty-recipes-shoots/dp/1849757097/ref=asap_bc?ie=UTF8' - const meta = omit(await metascraper({ html, url }), ['date']) - snapshot(meta) + const metadata = omit(await metascraper({ html, url }), ['date']) + snapshot(metadata) }) }) diff --git a/packages/metascraper-author/index.js b/packages/metascraper-author/index.js index c33a47354..2809e2cf2 100644 --- a/packages/metascraper-author/index.js +++ b/packages/metascraper-author/index.js @@ -1,16 +1,9 @@ 'use strict' -const { getValue, isUrl, titleize } = require('@metascraper/helpers') -const { isString } = require('lodash') +const { $filter, author } = require('@metascraper/helpers') const REGEX_STRICT = /^\S+\s+\S+/ -const validator = value => ( - isString(value) && - !isUrl(value, {relative: false}) && - titleize(value, {removeBy: true}) -) - /** * Wrap a rule with validation and formatting logic. * @@ -20,7 +13,7 @@ const validator = value => ( const wrap = rule => ({ htmlDom }) => { const value = rule(htmlDom) - return validator(value) + return author(value) } /** @@ -44,16 +37,14 @@ module.exports = () => ({ wrap($ => $('meta[name="author"]').attr('content')), wrap($ => $('meta[property="author"]').attr('content')), wrap($ => $('meta[property="article:author"]').attr('content')), - wrap($ => getValue($, $('[itemprop*="author"] [itemprop="name"]'))), - wrap($ => getValue($, $('[itemprop*="author"]'))), - wrap($ => getValue($, $('[rel="author"]'))), - strict(wrap($ => getValue($, $('a[class*="author"]')))), - strict(wrap($ => getValue($, $('[class*="author"] a')))), - strict(wrap($ => getValue($, $('a[href*="/author/"]')))), - wrap($ => getValue($, $('a[class*="screenname"]'))), - strict(wrap($ => getValue($, $('[class*="author"]')))), - strict(wrap($ => getValue($, $('[class*="byline"]')))) + wrap($ => $filter($, $('[itemprop*="author"] [itemprop="name"]'))), + wrap($ => $filter($, $('[itemprop*="author"]'))), + wrap($ => $filter($, $('[rel="author"]'))), + strict(wrap($ => $filter($, $('a[class*="author"]')))), + strict(wrap($ => $filter($, $('[class*="author"] a')))), + strict(wrap($ => $filter($, $('a[href*="/author/"]')))), + wrap($ => $filter($, $('a[class*="screenname"]'))), + strict(wrap($ => $filter($, $('[class*="author"]')))), + strict(wrap($ => $filter($, $('[class*="byline"]')))) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-date/index.js b/packages/metascraper-date/index.js index 3a504b112..820d19730 100644 --- a/packages/metascraper-date/index.js +++ b/packages/metascraper-date/index.js @@ -1,25 +1,6 @@ 'use strict' -const chrono = require('chrono-node') -const isIso = require('isostring') - -const validator = value => { - if (!value) return false - - // remove whitespace for easier parsing - value = value.trim() - - // convert isodates to restringify, because sometimes they are truncated - if (isIso(value)) return new Date(value).toISOString() - - // try to parse with the built-in date parser - const native = new Date(value) - if (!isNaN(native.getTime())) return native.toISOString() - - // try to parse a complex date string - const parsed = chrono.parseDate(value) - if (parsed) return parsed.toISOString() -} +const { date } = require('@metascraper/helpers') /** * Wrap a rule with validation and formatting logic. @@ -30,7 +11,7 @@ const validator = value => { const wrap = rule => ({ htmlDom }) => { const value = rule(htmlDom) - return validator(value) + return date(value) } /** @@ -68,5 +49,3 @@ module.exports = () => ({ wrap($ => $('[class*="time"]').text()) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-date/package.json b/packages/metascraper-date/package.json index 04df1e766..04aa43e91 100644 --- a/packages/metascraper-date/package.json +++ b/packages/metascraper-date/package.json @@ -16,8 +16,7 @@ "url": "https://github.com/microlinkhq/metascraper/issues" }, "dependencies": { - "chrono-node": "~1.3.5", - "isostring": "0.0.1" + "@metascraper/helpers": "^4.0.1" }, "devDependencies": { "standard": "latest" diff --git a/packages/metascraper-description/index.js b/packages/metascraper-description/index.js index 140cf3970..d68d8c75d 100644 --- a/packages/metascraper-description/index.js +++ b/packages/metascraper-description/index.js @@ -1,16 +1,6 @@ 'use strict' -const { getValue, titleize } = require('@metascraper/helpers') -const { isString } = require('lodash') - -const REGEX_LOCATION = /^[A-Z\s]+\s+[-—–]\s+/ - -const removeLocation = value => value.replace(REGEX_LOCATION, '') - -const validator = value => ( - isString(value) && - titleize(removeLocation(value), { capitalize: false }) -) +const { $filter, description } = require('@metascraper/helpers') /** * Wrap a rule with validation and formatting logic. @@ -21,7 +11,7 @@ const validator = value => ( const wrap = rule => ({ htmlDom }) => { const value = rule(htmlDom) - return validator(value) + return description(value) } /** @@ -35,9 +25,7 @@ module.exports = () => ({ wrap($ => $('meta[name="description"]').attr('content')), wrap($ => $('meta[itemprop="description"]').attr('content')), wrap($ => $('#description').text()), - wrap($ => getValue($, $('[class*="content"] > p'))), - wrap($ => getValue($, $('[class*="content"] p'))) + wrap($ => $filter($, $('[class*="content"] > p'))), + wrap($ => $filter($, $('[class*="content"] p'))) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-description/package.json b/packages/metascraper-description/package.json index be3e925f2..06a28c953 100644 --- a/packages/metascraper-description/package.json +++ b/packages/metascraper-description/package.json @@ -16,8 +16,7 @@ "url": "https://github.com/microlinkhq/metascraper/issues" }, "dependencies": { - "@metascraper/helpers": "^4.0.1", - "lodash": "~4.17.10" + "@metascraper/helpers": "^4.0.1" }, "devDependencies": { "standard": "latest" diff --git a/packages/metascraper-helpers/index.js b/packages/metascraper-helpers/index.js index 808d2a07b..39fb96f56 100644 --- a/packages/metascraper-helpers/index.js +++ b/packages/metascraper-helpers/index.js @@ -1,34 +1,48 @@ 'use strict' +const { toLower, replace, includes, isString, trim, flow, isEmpty } = require('lodash') const condenseWhitespace = require('condense-whitespace') -const { trim, flow, isEmpty } = require('lodash') +const videoExtensions = require('video-extensions') +const audioExtensions = require('audio-extensions') const isRelativeUrl = require('is-relative-url') +const fileExtension = require('file-extension') const { resolve: resolveUrl } = require('url') -const sanetizeUrl = require('normalize-url') +const _normalizeUrl = require('normalize-url') const smartquotes = require('smartquotes') -const toTitle = require('title') +const chrono = require('chrono-node') const urlRegex = require('url-regex') +const isIso = require('isostring') +const toTitle = require('title') +const { URL } = require('url') const REGEX_BY = /^[\s\n]*by|@[\s\n]*/i -const urlTest = (url, {relative = true}) => relative +const REGEX_LOCATION = /^[A-Z\s]+\s+[-—–]\s+/ + +const removeLocation = value => replace(value, REGEX_LOCATION, '') + +const urlTest = (url, { relative = true }) => relative ? isRelativeUrl(url) || urlRegex().test(url) : urlRegex().test(url) const isUrl = (url, opts = {}) => !isEmpty(url) && urlTest(url, opts) -const normalizeUrl = (url, opts) => sanetizeUrl(url, { - normalizeHttp: false, - stripWWW: false, - sortQueryParameters: false, - removeTrailingSlash: false, - ...opts -}) +const absoluteUrl = (baseUrl, relativePath = '') => ( + resolveUrl(baseUrl, relativePath) +) -const getAbsoluteUrl = (baseUrl, relativePath = '') => resolveUrl(baseUrl, relativePath) +const sanetizeUrl = (url, opts) => ( + _normalizeUrl(url, { + normalizeHttp: false, + stripWWW: false, + sortQueryParameters: false, + removeTrailingSlash: false, + ...opts + }) +) -const getUrl = (baseUrl, relativePath, opts) => ( - normalizeUrl(getAbsoluteUrl(baseUrl, relativePath), opts) +const normalizeUrl = (baseUrl, relativePath, opts) => ( + sanetizeUrl(absoluteUrl(baseUrl, relativePath), opts) ) const removeByPrefix = flow([ @@ -47,16 +61,80 @@ const titleize = (src, { capitalize = false, removeBy = false } = {}) => { const defaultFn = el => el.text().trim() -const getValue = ($, collection, fn = defaultFn) => { +const $filter = ($, collection, fn = defaultFn) => { const el = collection.filter((i, el) => fn($(el))).first() return fn(el) } +const isAuthor = (str, opts = { relative: false }) => ( + isString(str) && !isUrl(str, opts) +) + +const getAuthor = (str, opts = { removeBy: true }) => titleize(str, opts) + +const protocol = url => { + const { protocol = '' } = new URL(url) + return protocol.replace(':', '') +} + +const createUrlExtensionValidator = collection => url => ( + isUrl(url) && includes(collection, extension(url)) +) + +const isVideoUrl = createUrlExtensionValidator(videoExtensions) + +const isAudioUrl = createUrlExtensionValidator(audioExtensions) + +const extension = url => fileExtension(url).split('?')[0] + +const description = value => isString(value) && getDescription(value) + +const getDescription = value => titleize(removeLocation(value), { capitalize: false }) + +const publisher = value => isString(value) && condenseWhitespace(value) + +const author = value => isAuthor(value) && getAuthor(value) + +const url = (value, { url }) => isUrl(value) && normalizeUrl(url, value) + +const date = value => { + if (!value) return false + + // remove whitespace for easier parsing + value = value.trim() + + // convert isodates to restringify, because sometimes they are truncated + if (isIso(value)) return new Date(value).toISOString() + + // try to parse with the built-in date parser + const native = new Date(value) + if (!isNaN(native.getTime())) return native.toISOString() + + // try to parse a complex date string + const parsed = chrono.parseDate(value) + if (parsed) return parsed.toISOString() +} + +const lang = value => isString(value) && toLower(value.substring(0, 2)) + +const title = value => isString(value) && titleize(value) + module.exports = { + author, + title, + lang, + url, + description, + date, + $filter, titleize, - getUrl, - isUrl, + absoluteUrl, + sanetizeUrl, + extension, + protocol, + publisher, normalizeUrl, - getAbsoluteUrl, - getValue + isUrl, + isVideoUrl, + isAudioUrl } diff --git a/packages/metascraper-helpers/package.json b/packages/metascraper-helpers/package.json index b858a489f..44524754f 100644 --- a/packages/metascraper-helpers/package.json +++ b/packages/metascraper-helpers/package.json @@ -16,13 +16,18 @@ "url": "https://github.com/microlinkhq/metascraper/issues" }, "dependencies": { + "audio-extensions": "0.0.0", + "chrono-node": "~1.3.5", "condense-whitespace": "~1.0.0", + "file-extension": "~4.0.5", "is-relative-url": "~2.0.0", + "isostring": "0.0.1", "lodash": "~4.17.10", "normalize-url": "~3.2.0", "smartquotes": "~2.3.1", "title": "~3.3.2", - "url-regex": "~4.1.1" + "url-regex": "~4.1.1", + "video-extensions": "~1.1.0" }, "devDependencies": { "mocha": "latest", diff --git a/packages/metascraper-helpers/test/index.js b/packages/metascraper-helpers/test/index.js index 4f930d154..1ed005d95 100644 --- a/packages/metascraper-helpers/test/index.js +++ b/packages/metascraper-helpers/test/index.js @@ -2,20 +2,20 @@ const should = require('should') -const { getAbsoluteUrl } = require('../') +const { absoluteUrl } = require('../') describe('metascraper-helpers', () => { - it('getAbsoluteUrl', () => { - should(getAbsoluteUrl('https://kikobeats.com/', 'blog')).be.equal( + it('absoluteUrl', () => { + should(absoluteUrl('https://kikobeats.com/', 'blog')).be.equal( 'https://kikobeats.com/blog' ) - should(getAbsoluteUrl('https://kikobeats.com', '/blog')).be.equal( + should(absoluteUrl('https://kikobeats.com', '/blog')).be.equal( 'https://kikobeats.com/blog' ) - should(getAbsoluteUrl('https://kikobeats.com/', '/blog')).be.equal( + should(absoluteUrl('https://kikobeats.com/', '/blog')).be.equal( 'https://kikobeats.com/blog' ) - should(getAbsoluteUrl('http://kikobeats.com/', '/blog')).be.equal( + should(absoluteUrl('http://kikobeats.com/', '/blog')).be.equal( 'http://kikobeats.com/blog' ) }) diff --git a/packages/metascraper-image/index.js b/packages/metascraper-image/index.js index 880e296f7..932e5b94e 100644 --- a/packages/metascraper-image/index.js +++ b/packages/metascraper-image/index.js @@ -1,8 +1,6 @@ 'use strict' -const { getValue, getUrl, isUrl } = require('@metascraper/helpers') - -const validator = (value, url) => isUrl(value) && getUrl(url, value) +const { $filter, url: urlFn } = require('@metascraper/helpers') /** * Wrap a rule with validation and formatting logic. @@ -13,7 +11,7 @@ const validator = (value, url) => isUrl(value) && getUrl(url, value) const wrap = rule => ({ htmlDom, url }) => { const value = rule(htmlDom) - return validator(value, url) + return urlFn(value, { url }) } const getSrc = el => el.attr('src') @@ -29,11 +27,9 @@ module.exports = () => ({ wrap($ => $('meta[name="twitter:image:src"]').attr('content')), wrap($ => $('meta[name="twitter:image"]').attr('content')), wrap($ => $('meta[itemprop="image"]').attr('content')), - wrap($ => getValue($, $('article img[src]'), getSrc)), - wrap($ => getValue($, $('#content img[src]'), getSrc)), + wrap($ => $filter($, $('article img[src]'), getSrc)), + wrap($ => $filter($, $('#content img[src]'), getSrc)), wrap($ => $('img[alt*="author"]').attr('src')), wrap($ => $('img[src]').attr('src')) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-lang/index.js b/packages/metascraper-lang/index.js index 41e159dee..50b146606 100644 --- a/packages/metascraper-lang/index.js +++ b/packages/metascraper-lang/index.js @@ -1,12 +1,10 @@ 'use strict' -const { isString, toLower } = require('lodash') - -const validator = value => isString(value) && toLower(value.substring(0, 2)) +const { lang } = require('@metascraper/helpers') const wrap = rule => ({ htmlDom }) => { const value = rule(htmlDom) - return validator(value) + return lang(value) } module.exports = () => ({ @@ -15,5 +13,3 @@ module.exports = () => ({ wrap($ => $('html').attr('lang')) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-lang/package.json b/packages/metascraper-lang/package.json index d14db8789..fe98c6902 100644 --- a/packages/metascraper-lang/package.json +++ b/packages/metascraper-lang/package.json @@ -16,7 +16,7 @@ "url": "https://github.com/microlinkhq/metascraper/issues" }, "dependencies": { - "lodash": "~4.17.10" + "@metascraper/helpers": "^4.0.1" }, "devDependencies": { "mocha": "latest", diff --git a/packages/metascraper-lang/test/index.js b/packages/metascraper-lang/test/index.js index d377d8227..a9d31eecb 100644 --- a/packages/metascraper-lang/test/index.js +++ b/packages/metascraper-lang/test/index.js @@ -11,7 +11,7 @@ const metascraper = require('metascraper')([ require('metascraper-date')(), require('metascraper-description')(), require('metascraper-image')(), - require('metascraper-lang')(), + require('..')(), require('metascraper-logo')(), require('metascraper-publisher')(), require('metascraper-title')(), diff --git a/packages/metascraper-logo-favicon/test/index.js b/packages/metascraper-logo-favicon/test/index.js index 56908f0a9..e23e4b2cb 100644 --- a/packages/metascraper-logo-favicon/test/index.js +++ b/packages/metascraper-logo-favicon/test/index.js @@ -13,7 +13,7 @@ const metascraper = require('metascraper')([ require('metascraper-description')(), require('metascraper-image')(), require('metascraper-logo')(), - require('metascraper-logo-favicon')(), + require('..')(), require('metascraper-publisher')(), require('metascraper-title')(), require('metascraper-url')() diff --git a/packages/metascraper-logo/index.js b/packages/metascraper-logo/index.js index 854c9eaa2..74b9462ed 100644 --- a/packages/metascraper-logo/index.js +++ b/packages/metascraper-logo/index.js @@ -1,7 +1,7 @@ 'use strict' const { flow, chain, first, concat, toNumber, split } = require('lodash') -const { getUrl, isUrl } = require('@metascraper/helpers') +const { url: urlFn } = require('@metascraper/helpers') const getSize = flow([str => split(str, 'x'), first, toNumber]) @@ -31,8 +31,6 @@ const sizeSelectors = [ { tag: 'link[rel="shortcut icon"]', attr: 'href' } ] -const validator = (value, url) => isUrl(value) && getUrl(url, value) - /** * Wrap a rule with validation and formatting logic. * @@ -42,7 +40,7 @@ const validator = (value, url) => isUrl(value) && getUrl(url, value) const wrap = rule => ({ htmlDom, url }) => { const value = rule(htmlDom) - return validator(value, url) + return urlFn(value, { url }) } /** @@ -56,10 +54,11 @@ module.exports = () => ({ wrap($ => $('img[itemprop="logo"]').attr('src')), wrap($ => { const sizes = getSizes($, sizeSelectors) - const size = chain(sizes).first().get('link').value() + const size = chain(sizes) + .first() + .get('link') + .value() return size }) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-media-provider/__snapshots__/index.js.snap-shot b/packages/metascraper-media-provider/__snapshots__/index.js.snap-shot index d4e68481d..a2a652fb3 100644 --- a/packages/metascraper-media-provider/__snapshots__/index.js.snap-shot +++ b/packages/metascraper-media-provider/__snapshots__/index.js.snap-shot @@ -1,55 +1,108 @@ -exports['twitter 1'] = { +exports['twitter 1'] = [ + "https://video.twimg.com/amplify_video/943561675927519232/vid/240x240/mijiQdCq-p9FaO8H.mp4", + "https://video.twimg.com/amplify_video/943561675927519232/vid/480x480/qURzB_XtWBE-dvRa.mp4", + "https://video.twimg.com/amplify_video/943561675927519232/vid/720x720/h1uN7biCI-Fbzm9D.mp4" +] + +exports['vimeo 1'] = [ + "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603785.mp4%2A~hmac=c1d7138053fb25092b67c26ddcbd2fc8087da208a30f47a74025e62f844ed1ba/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603785.mp4", + "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603780.mp4%2A~hmac=f4c67d41844557065d91bed1f1e24ac1061252f8a37ddad76af75b84f8798429/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603780.mp4", + "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603783.mp4%2A~hmac=69a7fc2bb5ccbb888ad958f68b8f6e7b480cd635249a8f6e06fa7bd5dc600a3f/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603783.mp4", + "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603782.mp4%2A~hmac=1ff98e8349d222bbb11b2e7e3105729a578f83c632a34e252db61034b2b05d6b/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603782.mp4" +] + +exports['youtube 1'] = [ + "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889801167&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=160&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=503873&signature=5CCB9E814DC47000AE95012B9BAC5E638CF7B335.AEBC98B5759C5A7B2BFCD057539543D7FF3F0682&ratebypass=yes", + "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889799661&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=133&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=916551&signature=CB679D12966286AEDBC316AF52CB1502D31252C6.28D58615691F9E540559B860B5719E7A55C90BC0&ratebypass=yes", + "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889802693&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=134&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=2207390&signature=90CC91716540A24CFC117B94831E34CBF2E11519.1253E700A2076681949A8077EF0A0CC13EE0A70A&ratebypass=yes", + "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889999957&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=135&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=4380005&signature=20C47063DBB07F696EA3ADDB14B9127CB5C5CB3A.B722ED0B37D06C014D5747F1481559B0D0B36D66&ratebypass=yes", + "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952890403137&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=136&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=8054202&signature=2B28B5EC1C1EE32C0BE79537EE448B1BF0441A57.09D9F53E9F626EB8DB06508DCA3AA28B4C89D183&ratebypass=yes", + "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952977382584&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=137&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=14903843&signature=16960EBA740BA2C11F88FC697A42F7D0E52EA2EC.4AC8D17A3BED6B6E68AB92CFE3F598341A9D839A&ratebypass=yes" +] + +exports['vimeo 2'] = { + "publisher": "Vimeo", + "video": [ + "https://gcs-vimeo.akamaized.net/exp=1535802783~acl=%2A%2F823603785.mp4%2A~hmac=455bf895fafc1d034c3e793e91f96d8c87db9ce5ca7e54f9698a508f31b51c47/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603785.mp4", + "https://gcs-vimeo.akamaized.net/exp=1535802783~acl=%2A%2F823603780.mp4%2A~hmac=74b624180b954cf19ac3399164c6f9102b234663e6f6a41f1c8715c04348d0be/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603780.mp4", + "https://gcs-vimeo.akamaized.net/exp=1535802783~acl=%2A%2F823603783.mp4%2A~hmac=98f11f868f2e7ac772f72e38f71b29c4b32340f3b9f2833899538f040959c7aa/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603783.mp4", + "https://gcs-vimeo.akamaized.net/exp=1535802783~acl=%2A%2F823603782.mp4%2A~hmac=59349fbcb43c5c6f3e90f9ffbdec8ebc5013ebbb4e883e4702d66fd77dac11ea/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603782.mp4" + ], + "audio": null, + "author": "pleid", + "title": "Converse - Past meets Present - Montage", + "date": "2016-10-20T13:06:52.000Z", + "image": "https://i.vimeocdn.com/video/598160082_1280.jpg", + "description": "Converse has spent a good part of this year updating some of their classics. Our past is constantly catching up to us, but we rarely get to see the relationship between past and present. The sneaker company gave us access to some of the original footwear to create a series of dynamic, thrilling and unexpected motion pieces wherein we watch the old versions turn into the updated models.\nCREDITS\nClient: Converse USA\nAgency: Anomaly NYC\nArt Direction: Serial Cut\nAnimation: Pleid\nSound Design: Heardcity", + "lang": "en", + "logo": "https://i.vimeocdn.com/favicon/main-touch_180", + "url": "https://vimeo.com/188175573" +} + +exports['twitter 2'] = { + "publisher": "Twitter", + "video": [ + "https://video.twimg.com/amplify_video/943561675927519232/vid/240x240/mijiQdCq-p9FaO8H.mp4", + "https://video.twimg.com/amplify_video/943561675927519232/vid/480x480/qURzB_XtWBE-dvRa.mp4", + "https://video.twimg.com/amplify_video/943561675927519232/vid/720x720/h1uN7biCI-Fbzm9D.mp4" + ], + "audio": null, "author": "The Verge", - "publisher": "TwitterCard", + "title": "The Verge - Is it bad to blow into game cartridges?", "date": "2018-02-11T12:00:00.000Z", - "description": "“Is it bad to blow into game cartridges? https://t.co/Y3yAimrUnP”", "image": "https://pbs.twimg.com/media/DRg1OMRVwAEuwTK.jpg", + "description": "The Verge on Twitter: “Is it bad to blow into game cartridges? https://t.co/Y3yAimrUnP”", "lang": "es", "logo": "https://abs.twimg.com/icons/apple-touch-icon-192x192.png", "url": "https://twitter.com/verge/status/957383241714970624" } exports['facebook 1'] = { - "author": "AFC Ajax", "publisher": "Facebook", + "video": [ + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/29931969_132780680897191_2050692595729825792_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjNfNDI2X2NyZl8yM19tYWluXzMuMF9mcmFnXzJfYXVkaW8ifQ==&oh=aac6c17157da877a8162db4b6f8a6eb0&oe=5B8AA468", + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/29977283_989743217849704_1908790191984738304_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjNfMjU2X2NyZl8yM19tYWluXzMuMF9mcmFnXzJfdmlkZW8ifQ==&oh=bb4b0f8bbf893c8be55113af6de832c3&oe=5B8AA307", + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/29980789_2051987191737646_5699976528746512384_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjNfMzgwX2NyZl8yOF9iYXNlbGluZV8zLjBfYTIwdm5jZDJfb3RwMl9mcmFnXzJfdmlkZW8ifQ==&oh=2b86aa92071f92bd9770c86f9d651bf0&oe=5B8AA4E7", + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/30015739_434285990360734_6829180725728641024_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjRfaHEzX2ZyYWdfMl92aWRlbyJ9&oh=caa0d53f322ab7bad1952553b0d9b4d6&oe=5B8AA683", + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/29924134_184843515654220_5433876658782208_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjNfNjQwX2NyZl8yM19tYWluXzMuMF9mcmFnXzJfdmlkZW8ifQ==&oh=d630f36ab892b4032f76a829142fa11c&oe=5B8AA526", + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/10000000_205740473532514_2439904288734969856_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjNfODU0X2NyZl8yM19tYWluXzMuMF9mcmFnXzJfdmlkZW8ifQ==&oh=2531d28c98cd63fd46b3de39a8b16ff9&oe=5B8A9E9C", + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/10000000_566307827066937_5067446288358834176_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjRfaHEyX2ZyYWdfMl92aWRlbyJ9&oh=5ac0d1ef4b37a002d16ac02c55f432fe&oe=5B8AA4FA", + "https://video-cdg2-1.xx.fbcdn.net/v/t42.1790-2/10000000_608377619513235_2375849764957716480_n.mp4?_nc_cat=0&efg=eyJ2ZW5jb2RlX3RhZyI6ImRhc2hfdjRfaHE1X2ZyYWdfMl92aWRlbyJ9&oh=bb1b0b07e5ef3e266d73e2f16c3c9521&oe=5B8AA2AE" + ], + "audio": null, + "author": "AFC Ajax", + "title": "̶A̶n̶d̶e̶r̶l̶e̶c̶h̶t̶ ✔️ ̶J̶u̶v̶e̶n̶t̶u̶s̶ ✔️ W I N N E R S 👉 #Aj...", "date": "2018-04-02T18:57:00.000Z", + "image": "https://scontent-cdg2-1.xx.fbcdn.net/v/t15.0-10/p720x720/27603335_1686838558030152_6228738417937612800_n.jpg?_nc_cat=0&oh=48f6c7c84736eac9eeb2b9c086e5ec50&oe=5C2D7661", "description": null, - "image": null, "lang": "es", "logo": "https://static.xx.fbcdn.net/rsrc.php/yp/r/1Dxu6XIjaTc.ico", "url": "https://www.facebook.com/afcajax/videos/1686831701364171" } -exports['youtube 1'] = { +exports['youtube 2'] = { + "publisher": "ES", + "video": [ + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=503873&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&keepalive=yes&gir=yes&requiressl=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.440&itag=160&lmt=1507952889801167&ipbits=0&mime=video%2Fmp4&key=yt6&expire=1535820501&fvip=3&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&signature=DCC5BC32D5619CF7167A9D0AD5E5CC7E630D82CF.B85EBA0064EE53C520BB88100C58DDC992BFE405&ratebypass=yes", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=916551&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&keepalive=yes&gir=yes&requiressl=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.440&itag=133&lmt=1507952889799661&ipbits=0&mime=video%2Fmp4&key=yt6&expire=1535820501&fvip=3&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&signature=1D53A389B5F340AB723944F8D3F2BAF727AC5D95.20BBE3CAB8BA637A533E6F067DA85F0C1B637BE4&ratebypass=yes", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=2207390&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&keepalive=yes&gir=yes&requiressl=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.440&itag=134&lmt=1507952889802693&ipbits=0&mime=video%2Fmp4&key=yt6&expire=1535820501&fvip=3&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&signature=5555B2065D925F10563FC81E4C5B3125A4F1FF3E.A4EAB84294474AE066F5815F446BB3E5A3849607&ratebypass=yes", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=4380005&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&keepalive=yes&gir=yes&requiressl=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.440&itag=135&lmt=1507952889999957&ipbits=0&mime=video%2Fmp4&key=yt6&expire=1535820501&fvip=3&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&signature=DE41C7D2B2E71B9D57CFC036F7940C19D9B4448B.ADECA95DD10A829BE51B126CDF0D70CE40B3B360&ratebypass=yes", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=8054202&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&keepalive=yes&gir=yes&requiressl=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.440&itag=136&lmt=1507952890403137&ipbits=0&mime=video%2Fmp4&key=yt6&expire=1535820501&fvip=3&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&signature=20213749D025C5000B9B4F05AD1407873E874A3D.4E1F67BF49DA23F24E57216BF9A35546A50A6D24&ratebypass=yes", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=14903843&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&keepalive=yes&gir=yes&requiressl=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.440&itag=137&lmt=1507952977382584&ipbits=0&mime=video%2Fmp4&key=yt6&expire=1535820501&fvip=3&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&signature=05E8187F34D11C1BDC529E1E4D198B08CA274C1B.56A61CAE660F0B1D7EE3493E7FFD4BC1019A117B&ratebypass=yes" + ], + "audio": [ + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=1187373&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&gir=yes&requiressl=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.548&itag=17&lmt=1503811657072536&ipbits=0&mime=video%2F3gpp&key=yt6&expire=1535820501&fvip=3&signature=4AF939F4FCCDDDBC3479E11BBE050FB8CE2602E7.36D1EF162722A97D7E0D1E2209E3A784B419D2A4&ratebypass=yes", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=6322851&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&gir=yes&requiressl=yes&ratebypass=yes&source=youtube&initcwndbps=240000&pl=24&dur=141.502&itag=18&lmt=1503811655561063&ipbits=0&mime=video%2Fmp4&key=yt6&expire=1535820501&fvip=3&signature=1FF6968AA3B913F6908D66AF0C9CD766CE049CF5.7A97845B24B922691386EA748CD92B7C84A62257", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&mn=sn-aigzrn7d%2Csn-4g5ednss&ms=au%2Conr&mt=1535798742&mv=m&ei=dW6KW9qtF8ec1wb-hJCABw&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ip=95.131.170.236&clen=7126000&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&gir=yes&requiressl=yes&ratebypass=yes&source=youtube&initcwndbps=240000&pl=24&dur=0.000&itag=43&lmt=1503812251410108&ipbits=0&mime=video%2Fwebm&key=yt6&expire=1535820501&fvip=3&signature=C574199D94DEB600ED2B0B96D11D1CBECEDA365E.D88E911D701BD67F6742B136A4D7020B369528AA", + "https://r3---sn-aigzrn7d.googlevideo.com/videoplayback?c=WEB&mm=31%2C26&ipbits=0&ms=au%2Conr&ratebypass=yes&source=youtube&mv=m&initcwndbps=240000&pl=24&mn=sn-aigzrn7d%2Csn-4g5ednss&dur=141.502&ei=dW6KW9qtF8ec1wb-hJCABw&itag=22&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&lmt=1507953047549769&ip=95.131.170.236&mime=video%2Fmp4&key=yt6&expire=1535820501&id=o-AD6ZD2aepAs4ud0h7euE2Y_dE0uZ1_Y0GVZQIMMFwXwu&requiressl=yes&fvip=3&mt=1535798742&signature=1000EAC9C47F59E0E655EE9145732C466F47256B.81478A0BDF1948A0A05679894DF33C8729D8364E" + ], "author": "ONE Media", - "publisher": "Youtube", + "title": "Star Wars 8 THE LAST JEDI Official TRAILER (2017) Daisy Ridley, Disney Movie HD", "date": "2017-04-14T12:00:00.000Z", - "description": "Star Wars 8 El Ultimo JEDI Trailer Espanol (Subtitulado) - 2017\n© 2017 - Disney", - "image": "https://i.ytimg.com/vi/hwMkbaS_M_c/mqdefault.jpg", + "image": "https://i.ytimg.com/vi/hwMkbaS_M_c/maxresdefault.jpg", + "description": "Star Wars 8 THE LAST JEDI Official TRAILER (2017) Daisy Ridley, Disney Movie HD\n© 2017 - Disney", "lang": null, "logo": "https://www.youtube.com/yts/img/favicon_144-vfliLAfaB.png", "url": "https://www.youtube.com/watch?v=hwMkbaS_M_c" } -exports['vimeo 1'] = { - "author": "pleid", - "publisher": "Vimeo", - "date": "2016-10-20T13:06:52.000Z", - "description": "Converse has spent a good part of this year updating some of their classics. Our past is constantly catching up to us, but we rarely get to see the relationship…", - "image": "https://i.vimeocdn.com/filter/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F598160082_1280x720.jpg&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png", - "lang": "en", - "logo": "https://i.vimeocdn.com/favicon/main-touch_180", - "url": "https://vimeo.com/188175573" -} - -exports['filter by mp4 1'] = [ - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=160&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184853954309&fvip=4&source=youtube&clen=1232192&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=B71A314816CBE56289EC15C8A1C6BF7EE74C169D.164175CF39A4BDFD2DA2DE6147BD09545AAA01DE&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=133&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184853956556&fvip=4&source=youtube&clen=2122314&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=E3307C18153DDB5E7AACAEAB9942F8B002012050.173DE890AE005232725CB8ADA7A50B7CF25692F0&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=134&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184854055225&fvip=4&source=youtube&clen=5015666&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=3DEFAB448DC70677960CAF56B11FB769592FC440.5CD5B13E517668562CCE3F430CF16734E3DD63CA&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=135&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184854155850&fvip=4&source=youtube&clen=9629112&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=B4B7A543DEAEEF890B8E6D2DCD83F8F07633DA9F.503058111885647E7E14FA29CA781D0AC0EACA6D&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=136&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184854254121&fvip=4&source=youtube&clen=18536895&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=15992BA735625E478060A1DFD9C01D00C0702BE4.C887CC9578BFCBE0ABF4FFCA47139C40B07436E3&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=298&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184834230729&fvip=4&source=youtube&clen=30831030&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=3ED7C0216A6CBFD79647E8BD4E9463A955EB2E8D.4B933FF684BCA75D1E10C2771A101A646875F4BF&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=18&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534185137343773&fvip=4&source=youtube&clen=14141551&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&ratebypass=yes&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&signature=250354E58D1DBCA03CBD4DC9E3FB244C5E1152A0.952F5690B6C36A18ADEA9DDA89ED78148CAFA2A4&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&dur=283.910&ei=KhRyW4nkJIvkV7yXvugN", - "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=22&mm=31%2C29&c=WEB&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mime=video%2Fmp4&ip=95.17.206.54&pl=20&signature=26B8FCB51DC7903132039080C3888D83EC65E0F1.07B5FDE4D99FF3C3354D4D164FBC3CA838F6DEFF&expire=1534224522&initcwndbps=928750&mv=m&mt=1534202758&ms=au%2Crdu&ipbits=0&lmt=1534185082305521&requiressl=yes&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&source=youtube&ratebypass=yes&dur=283.910&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&key=yt6&ei=KhRyW4nkJIvkV7yXvugN&fvip=4" -] - diff --git a/packages/metascraper-media-provider/package.json b/packages/metascraper-media-provider/package.json index dc3d42555..e91f3af0c 100644 --- a/packages/metascraper-media-provider/package.json +++ b/packages/metascraper-media-provider/package.json @@ -18,7 +18,6 @@ "dependencies": { "@metascraper/helpers": "^4.0.1", "got": "~9.1.0", - "json-future": "~2.1.2", "lodash": "~4.17.10", "youtube-dl": "~1.12.2" }, @@ -26,7 +25,6 @@ "mocha": "latest", "nyc": "latest", "puppeteer": "latest", - "should": "latest", "snap-shot": "latest", "standard": "latest" }, diff --git a/packages/metascraper-media-provider/src/get-video-info/index.js b/packages/metascraper-media-provider/src/get-video-info/index.js index ef7612028..c9b10d123 100644 --- a/packages/metascraper-media-provider/src/get-video-info/index.js +++ b/packages/metascraper-media-provider/src/get-video-info/index.js @@ -1,40 +1,46 @@ 'use strict' const { isTwitterUrl, getTwitterVideoInfo } = require('./twitter-video-info') -const getVideoInfo = require('./video-info') +const createGetVideoInfo = require('./video-info') + +const { protocol } = require('@metascraper/helpers') const { chain } = require('lodash') -const getInfo = async url => { - if (!isTwitterUrl(url)) return getVideoInfo(url) +// Local cache for successive calls +let cachedVideoInfoUrl +let cachedVideoInfo - const [videoInfo, twitterVideos] = await Promise.all([ - getVideoInfo(url), - getTwitterVideoInfo(url) - ]) +module.exports = opts => { + const getVideoInfo = createGetVideoInfo(opts) - const formats = chain(videoInfo.formats) - .reduce((acc, format, index) => { - const { url } = twitterVideos[index] - const item = { ...format, url } - return [...acc, item] - }, []) - .value() + const getInfo = async url => { + if (!isTwitterUrl(url)) return getVideoInfo(url) - return { ...videoInfo, formats } -} + const [videoInfo, twitterVideos] = await Promise.all([ + getVideoInfo(url), + getTwitterVideoInfo(url) + ]) -// Local cache for successive calls -let cachedVideoInfoUrl -let cachedVideoInfo + const formats = chain(videoInfo.formats) + .reduce((acc, format, index) => { + const { url } = twitterVideos[index] + const item = { ...format, url, protocol: protocol(url) } + return [...acc, item] + }, []) + .value() + + return { ...videoInfo, formats } + } -module.exports = async url => { - if (url === cachedVideoInfoUrl) return cachedVideoInfo - cachedVideoInfoUrl = url + return async url => { + if (url === cachedVideoInfoUrl) return cachedVideoInfo + cachedVideoInfoUrl = url - try { - cachedVideoInfo = await getInfo(url) - } catch (err) { - cachedVideoInfo = {} + try { + cachedVideoInfo = await getInfo(url) + } catch (err) { + cachedVideoInfo = {} + } + return cachedVideoInfo } - return cachedVideoInfo } diff --git a/packages/metascraper-media-provider/src/get-video-info/video-info.js b/packages/metascraper-media-provider/src/get-video-info/video-info.js index c91e07c95..bd08ca492 100644 --- a/packages/metascraper-media-provider/src/get-video-info/video-info.js +++ b/packages/metascraper-media-provider/src/get-video-info/video-info.js @@ -3,4 +3,9 @@ const youtubedl = require('youtube-dl') const { promisify } = require('util') -module.exports = promisify(youtubedl.getInfo) +const getInfo = promisify(youtubedl.getInfo) + +module.exports = ({ cacheDir } = {}) => { + const opts = cacheDir ? [`--cache-dir=${cacheDir}`] : [] + return url => getInfo(url, opts) +} diff --git a/packages/metascraper-media-provider/src/index.js b/packages/metascraper-media-provider/src/index.js index 730a80c42..4f8386c32 100644 --- a/packages/metascraper-media-provider/src/index.js +++ b/packages/metascraper-media-provider/src/index.js @@ -1,101 +1,126 @@ 'use strict' const { - overEvery, - isEmpty, - eq, - has, - get, chain, + eq, find, + has, + isEmpty, + isNil, + isString, negate, - isString + overEvery } = require('lodash') -const { isUrl, titleize } = require('@metascraper/helpers') -const path = require('path') -const getVideoInfo = require('./get-video-info') +const { + protocol: protocolFn, + extension: extensionFn, + author: authorFn, + description: descriptionFn, + title: titleFn, + url: urlFn +} = require('@metascraper/helpers') + +const createGetVideoInfo = require('./get-video-info') + +const isMIME = extension => ({ ext, url }) => + eq(ext, extension) || eq(extensionFn(url), extension) -const isMIME = ext => item => - eq(get(item, 'ext'), ext) || - path.extname(get(item, 'url')).startsWith(`.${ext}`) +const isProtocol = value => ({ protocol, url }) => + protocol ? eq(protocol, value) : protocolFn(url, value) +/* Most used formats + Seet at https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility +*/ const isMp4 = isMIME('mp4') const isMp3 = isMIME('mp3') const isM4a = isMIME('m4a') const isAac = isMIME('aac') +const isWav = isMIME('wav') + +const isHttp = isProtocol('http') +const isHttps = isProtocol('https') -const isHttp = item => eq(get(item, 'protocol'), 'http') -const isHttps = item => eq(get(item, 'protocol'), 'https') const hasAudio = item => has(item, 'abr') const hasVideo = item => has(item, 'tbr') +const hastNotVideo = negate(hasVideo) -const getFormatUrls = orderBy => (videos, filters = []) => { - const urls = chain(videos) +const getFormatUrls = ({ orderBy, filterBy }) => (formats, filters) => { + const urls = chain(formats) .filter(overEvery(filters)) .orderBy(orderBy, 'asc') .map('url') - .filter(isUrl) + .filter(url => !eq(extensionFn(url), 'm3u8')) .value() return isEmpty(urls) ? false : urls } -const getVideoUrls = getFormatUrls('tbr') -const getAudioUrls = getFormatUrls('abr') +const getVideoUrls = getFormatUrls({ orderBy: 'tbr' }) +const getAudioUrls = getFormatUrls({ orderBy: 'abr' }) const getVideo = ({ formats }) => - getVideoUrls(formats, [hasAudio, isMp4, isHttps]) || - getVideoUrls(formats, [hasAudio, isMp4, isHttp]) || - getVideoUrls(formats, [isMp4, isHttps]) || - getVideoUrls(formats, [isMp4, isHttp]) || - getVideoUrls(formats, [isMp4]) + getVideoUrls(formats, [hasVideo, hasAudio, isMp4, isHttps]) || + getVideoUrls(formats, [hasVideo, hasAudio, isMp4, isHttp]) || + getVideoUrls(formats, [hasVideo, isMp4, isHttps]) || + getVideoUrls(formats, [hasVideo, isMp4, isHttp]) || + getVideoUrls(formats, [hasVideo, hasAudio, isHttps]) || + getVideoUrls(formats, [hasVideo, hasAudio, isHttp]) || + getVideoUrls(formats, [hasVideo, isHttps]) || + getVideoUrls(formats, [hasVideo, isHttp]) const getAudio = ({ formats }) => - getAudioUrls(formats, [negate(hasVideo), isMp3, isHttps]) || - getAudioUrls(formats, [negate(hasVideo), isAac, isHttps]) || - getAudioUrls(formats, [negate(hasVideo), isM4a, isHttps]) || - getAudioUrls(formats, [negate(hasVideo), isMp3, isHttp]) || - getAudioUrls(formats, [negate(hasVideo), isAac, isHttp]) || - getAudioUrls(formats, [negate(hasVideo), isM4a, isHttp]) || - getAudioUrls(formats, [negate(hasVideo), isMp3]) || - getAudioUrls(formats, [negate(hasVideo), isAac]) || - getAudioUrls(formats, [negate(hasVideo), isM4a]) - -const getAuthor = ({ uploader, creator, uploader_id: uploaderId }) => { - const author = find( - [creator, uploader, uploaderId], - str => isString(str) && !isUrl(str, { relative: false }) - ) - return author && titleize(author, { removeBy: true }) -} + getAudioUrls(formats, [hastNotVideo, hasAudio, isMp3, isHttps]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isAac, isHttps]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isM4a, isHttps]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isWav, isHttps]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isMp3, isHttp]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isAac, isHttp]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isM4a, isHttp]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isWav, isHttp]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isHttps]) || + getAudioUrls(formats, [hastNotVideo, hasAudio, isHttp]) + +const getAuthor = ({ uploader, creator, uploader_id: uploaderId }) => + find([creator, uploader, uploaderId], str => authorFn(str)) const getPublisher = ({ extractor_key: extractorKey }) => isString(extractorKey) && extractorKey -const getTitle = ({ title: mainTitle, alt_title: secondaryTitle }) => { - const title = find([mainTitle, secondaryTitle], isString) - return title && titleize(title) -} +const getTitle = ({ title: mainTitle, alt_title: secondaryTitle }) => + find([mainTitle, secondaryTitle], titleFn) const getDate = ({ timestamp }) => - timestamp && new Date(timestamp * 1000).toISOString() + !isNil(timestamp) && new Date(timestamp * 1000).toISOString() + +const getImage = (url, { thumbnail }) => urlFn(thumbnail, { url }) + +const getDescription = (url, { description }) => descriptionFn(description) + +module.exports = opts => { + const getVideoInfo = createGetVideoInfo(opts) -module.exports = () => { return { - video: async ({ url }) => getVideo(await getVideoInfo(url)), + video: async ({ url }) => { + const payload = await getVideoInfo(url) + // console.log(JSON.stringify(payload)) + return getVideo(payload) + }, audio: async ({ url }) => getAudio(await getVideoInfo(url)), author: async ({ url }) => getAuthor(await getVideoInfo(url)), publisher: async ({ url }) => getPublisher(await getVideoInfo(url)), title: async ({ url }) => getTitle(await getVideoInfo(url)), - date: async ({ url }) => getDate(await getVideoInfo(url)) + date: async ({ url }) => getDate(await getVideoInfo(url)), + image: async ({ url }) => getImage(url, await getVideoInfo(url)), + description: async ({ url }) => getDescription(url, await getVideoInfo(url)) } } -module.exports.getFormatUrls = getFormatUrls -module.exports.getVideo = getVideo module.exports.getAudio = getAudio +module.exports.getImage = getImage module.exports.getAuthor = getAuthor +module.exports.getDate = getDate +module.exports.getFormatUrls = getFormatUrls module.exports.getPublisher = getPublisher module.exports.getTitle = getTitle -module.exports.getDate = getDate +module.exports.getVideo = getVideo diff --git a/packages/metascraper-media-provider/test/fixtures/twitter.json b/packages/metascraper-media-provider/test/fixtures/twitter.json new file mode 100644 index 000000000..444ebe545 --- /dev/null +++ b/packages/metascraper-media-provider/test/fixtures/twitter.json @@ -0,0 +1,115 @@ +{ + "display_id": "957383241714970624", + "extractor": "twitter:card", + "protocol": "https", + "description": "The Verge on Twitter: \"Is it bad to blow into game cartridges? https://t.co/Y3yAimrUnP\"", + "vcodec": "avc1.640020", + "format": "hls-1280 - 720x720", + "requested_subtitles": null, + "tbr": 1280, + "height": 720, + "_filename": "The Verge - Is it bad to blow into game cartridges-957383241714970624.mp4", + "preference": null, + "uploader": "The Verge", + "duration": "2:26.562999999999988", + "manifest_url": "https://video.twimg.com/amplify_video/943561675927519232/pl/YNw1OIz1A5FFywhq.m3u8", + "format_id": "hls-1280", + "uploader_id": "verge", + "playlist": null, + "thumbnails": [ + { + "url": "https://pbs.twimg.com/media/DRg1OMRVwAEuwTK.jpg", + "id": "0" + } + ], + "fps": null, + "title": "The Verge - Is it bad to blow into game cartridges?", + "url": "https://video.twimg.com/amplify_video/943561675927519232/pl/720x720/p0lEHBKAhtm_3T9E.m3u8", + "extractor_key": "TwitterCard", + "id": "957383241714970624", + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "playlist_index": null, + "width": 720, + "ext": "mp4", + "webpage_url": "https://twitter.com/verge/status/957383241714970624", + "formats": [ + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "hls-320 - 240x240", + "url": "https://video.twimg.com/amplify_video/943561675927519232/vid/240x240/mijiQdCq-p9FaO8H.mp4", + "vcodec": "avc1.4d0015", + "tbr": 320, + "height": 240, + "width": 240, + "ext": "mp4", + "preference": null, + "fps": null, + "manifest_url": "https://video.twimg.com/amplify_video/943561675927519232/pl/YNw1OIz1A5FFywhq.m3u8", + "format_id": "hls-320", + "acodec": "mp4a.40.2" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "hls-832 - 480x480", + "url": "https://video.twimg.com/amplify_video/943561675927519232/vid/480x480/qURzB_XtWBE-dvRa.mp4", + "vcodec": "avc1.4d001f", + "tbr": 832, + "height": 480, + "width": 480, + "ext": "mp4", + "preference": null, + "fps": null, + "manifest_url": "https://video.twimg.com/amplify_video/943561675927519232/pl/YNw1OIz1A5FFywhq.m3u8", + "format_id": "hls-832", + "acodec": "mp4a.40.2" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "hls-1280 - 720x720", + "url": "https://video.twimg.com/amplify_video/943561675927519232/vid/720x720/h1uN7biCI-Fbzm9D.mp4", + "vcodec": "avc1.640020", + "tbr": 1280, + "height": 720, + "width": 720, + "ext": "mp4", + "preference": null, + "fps": null, + "manifest_url": "https://video.twimg.com/amplify_video/943561675927519232/pl/YNw1OIz1A5FFywhq.m3u8", + "format_id": "hls-1280", + "acodec": "mp4a.40.2" + } + ], + "fulltitle": "The Verge - Is it bad to blow into game cartridges?", + "thumbnail": "https://pbs.twimg.com/media/DRg1OMRVwAEuwTK.jpg", + "webpage_url_basename": "957383241714970624", + "acodec": "mp4a.40.2", + "_duration_raw": 146.563, + "_duration_hms": "00:02:26.563" +} diff --git a/packages/metascraper-media-provider/test/fixtures/vimeo.json b/packages/metascraper-media-provider/test/fixtures/vimeo.json new file mode 100644 index 000000000..5cad8e992 --- /dev/null +++ b/packages/metascraper-media-provider/test/fixtures/vimeo.json @@ -0,0 +1,1166 @@ +{ + "display_id": "188175573", + "extractor": "vimeo", + "protocol": "https", + "description": "Converse has spent a good part of this year updating some of their classics. Our past is constantly catching up to us, but we rarely get to see the relationship between past and present. The sneaker company gave us access to some of the original footwear to create a series of dynamic, thrilling and unexpected motion pieces wherein we watch the old versions turn into the updated models.\nCREDITS\nClient: Converse USA\nAgency: Anomaly NYC\nArt Direction: Serial Cut\nAnimation: Pleid\nSound Design: Heardcity", + "uploader_id": "pleid", + "upload_date": "20161020", + "requested_subtitles": null, + "format": "Original - 1920x1080", + "formats": [ + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic-video-823603785 - 640x360 (DASH video)", + "tbr": 512, + "height": 360, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic-video-823603785", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001E", + "width": 640, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603785/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603785/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603785/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic_sep-video-823603785 - 640x360 (DASH video)", + "tbr": 512, + "height": 360, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic_sep-video-823603785", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001E", + "width": 640, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603785/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603785/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603785/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire-video-823603785 - 640x360 (DASH video)", + "tbr": 512, + "height": 360, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire-video-823603785", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001E", + "width": 640, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603785/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603785/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603785/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire_sep-video-823603785 - 640x360 (DASH video)", + "tbr": 512, + "height": 360, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire_sep-video-823603785", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001E", + "width": 640, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603785/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603785/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603785/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603785/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic-video-823603780 - 960x540 (DASH video)", + "tbr": 1435, + "height": 540, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic-video-823603780", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001F", + "width": 960, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603780/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603780/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603780/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic_sep-video-823603780 - 960x540 (DASH video)", + "tbr": 1435, + "height": 540, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic_sep-video-823603780", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001F", + "width": 960, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603780/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603780/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603780/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire-video-823603780 - 960x540 (DASH video)", + "tbr": 1435, + "height": 540, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire-video-823603780", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001F", + "width": 960, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603780/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603780/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603780/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire_sep-video-823603780 - 960x540 (DASH video)", + "tbr": 1435, + "height": 540, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire_sep-video-823603780", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.64001F", + "width": 960, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603780/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603780/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603780/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603780/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic-video-823603783 - 1280x720 (DASH video)", + "tbr": 2600, + "height": 720, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic-video-823603783", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640020", + "width": 1280, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603783/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603783/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603783/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic_sep-video-823603783 - 1280x720 (DASH video)", + "tbr": 2600, + "height": 720, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic_sep-video-823603783", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640020", + "width": 1280, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603783/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603783/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603783/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire-video-823603783 - 1280x720 (DASH video)", + "tbr": 2600, + "height": 720, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire-video-823603783", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640020", + "width": 1280, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603783/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603783/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603783/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire_sep-video-823603783 - 1280x720 (DASH video)", + "tbr": 2600, + "height": 720, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire_sep-video-823603783", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640020", + "width": 1280, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603783/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603783/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603783/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603783/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic-video-823603782 - 1920x1080 (DASH video)", + "tbr": 4925, + "height": 1080, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic-video-823603782", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640028", + "width": 1920, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603782/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603782/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603782/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-akfire_interconnect_quic_sep-video-823603782 - 1920x1080 (DASH video)", + "tbr": 4925, + "height": 1080, + "preference": -40, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-akfire_interconnect_quic_sep-video-823603782", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640028", + "width": 1920, + "ext": "mp4", + "fragment_base_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603782/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603782/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603782/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire-video-823603782 - 1920x1080 (DASH video)", + "tbr": 4925, + "height": 1080, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire-video-823603782", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640028", + "width": 1920, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603782/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603782/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603782/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "asr": null, + "format_note": "DASH video", + "protocol": "http_dash_segments", + "format": "dash-fastly_skyfire_sep-video-823603782 - 1920x1080 (DASH video)", + "tbr": 4925, + "height": 1080, + "preference": -40, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/master.mpd?base64_init=1", + "format_id": "dash-fastly_skyfire_sep-video-823603782", + "container": "mp4_dash", + "language": null, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "vcodec": "avc1.640028", + "width": 1920, + "ext": "mp4", + "fragment_base_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/sep/video/823603785,823603783,823603782,823603780/../", + "filesize": null, + "fps": 30, + "fragments": [ + { + "path": "823603782/chop/segment-0.mp4" + }, + { + "duration": 6, + "path": "823603782/chop/segment-1.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-2.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-3.m4s" + }, + { + "duration": 6, + "path": "823603782/chop/segment-4.m4s" + }, + { + "duration": 4.5, + "path": "823603782/chop/segment-5.m4s" + } + ], + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "http-360p - 640x360", + "url": "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603785.mp4%2A~hmac=c1d7138053fb25092b67c26ddcbd2fc8087da208a30f47a74025e62f844ed1ba/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603785.mp4", + "tbr": null, + "height": 360, + "width": 640, + "ext": "mp4", + "fps": 30, + "format_id": "http-360p" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-akfire_interconnect_quic-395 - 640x360", + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785/playlist.m3u8", + "vcodec": "avc1.64001E", + "tbr": 395, + "height": 360, + "width": 640, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-akfire_interconnect_quic-395", + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-fastly_skyfire-395 - 640x360", + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785/playlist.m3u8", + "vcodec": "avc1.64001E", + "tbr": 395, + "height": 360, + "width": 640, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-fastly_skyfire-395", + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "http-540p - 960x540", + "url": "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603780.mp4%2A~hmac=f4c67d41844557065d91bed1f1e24ac1061252f8a37ddad76af75b84f8798429/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603780.mp4", + "tbr": null, + "height": 540, + "width": 960, + "ext": "mp4", + "fps": 30, + "format_id": "http-540p" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-akfire_interconnect_quic-1081 - 960x540", + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603780/playlist.m3u8", + "vcodec": "avc1.64001F", + "tbr": 1081, + "height": 540, + "width": 960, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-akfire_interconnect_quic-1081", + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-fastly_skyfire-1081 - 960x540", + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603780/playlist.m3u8", + "vcodec": "avc1.64001F", + "tbr": 1081, + "height": 540, + "width": 960, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-fastly_skyfire-1081", + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "http-720p - 1280x720", + "url": "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603783.mp4%2A~hmac=69a7fc2bb5ccbb888ad958f68b8f6e7b480cd635249a8f6e06fa7bd5dc600a3f/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603783.mp4", + "tbr": null, + "height": 720, + "width": 1280, + "ext": "mp4", + "fps": 30, + "format_id": "http-720p" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-akfire_interconnect_quic-1935 - 1280x720", + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603783/playlist.m3u8", + "vcodec": "avc1.640020", + "tbr": 1935, + "height": 720, + "width": 1280, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-akfire_interconnect_quic-1935", + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-fastly_skyfire-1935 - 1280x720", + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603783/playlist.m3u8", + "vcodec": "avc1.640020", + "tbr": 1935, + "height": 720, + "width": 1280, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-fastly_skyfire-1935", + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "http-1080p - 1920x1080", + "url": "https://gcs-vimeo.akamaized.net/exp=1535800514~acl=%2A%2F823603782.mp4%2A~hmac=1ff98e8349d222bbb11b2e7e3105729a578f83c632a34e252db61034b2b05d6b/vimeo-prod-skyfire-std-us/01/2635/7/188175573/823603782.mp4", + "tbr": null, + "height": 1080, + "width": 1920, + "ext": "mp4", + "fps": 30, + "format_id": "http-1080p" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-akfire_interconnect_quic-3839 - 1920x1080", + "url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603782/playlist.m3u8", + "vcodec": "avc1.640028", + "tbr": 3839, + "height": 1080, + "width": 1920, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://174skyfiregce-vimeo.akamaized.net/exp=1535800514~acl=%2F188175573%2F%2A~hmac=ca857b9ab870f783ac48072974d3a30a68955540ecd5d6190ab9d0263cddbdec/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-akfire_interconnect_quic-3839", + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "m3u8_native", + "format": "hls-fastly_skyfire-3839 - 1920x1080", + "url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603782/playlist.m3u8", + "vcodec": "avc1.640028", + "tbr": 3839, + "height": 1080, + "width": 1920, + "ext": "mp4", + "preference": null, + "fps": 30, + "manifest_url": "https://skyfire.vimeocdn.com/1535800514-0x9d70ea322a34a8c90f5d82e5bdc2243c65f153d8/188175573/video/823603785,823603783,823603782,823603780/master.m3u8", + "format_id": "hls-fastly_skyfire-3839", + "acodec": "none" + }, + { + "protocol": "https", + "format": "Original - 1920x1080", + "url": "https://player.vimeo.com/play/823603079?s=188175573_1535796915_d75723e51221e86af027c51e428dc264&loc=external&context=Vimeo%5CController%5CClipController.main&download=1", + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "height": 1080, + "width": 1920, + "ext": "mp4", + "filesize": 31977000, + "format_id": "Original", + "preference": 1 + } + ], + "height": 1080, + "_filename": "Converse - Past meets Present - Montage-188175573.mp4", + "like_count": 350, + "preference": 1, + "uploader": "pleid", + "duration": "29", + "format_id": "Original", + "playlist_index": null, + "subtitles": {}, + "view_count": 8923, + "playlist": null, + "thumbnails": [ + { + "url": "https://i.vimeocdn.com/video/598160082_1280.jpg", + "id": "0" + } + ], + "title": "Converse - Past meets Present - Montage", + "url": "https://player.vimeo.com/play/823603079?s=188175573_1535796915_d75723e51221e86af027c51e428dc264&loc=external&context=Vimeo%5CController%5CClipController.main&download=1", + "extractor_key": "Vimeo", + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "ext": "mp4", + "id": "188175573", + "width": 1920, + "comment_count": 3, + "uploader_url": "https://vimeo.com/pleid", + "filesize": 31977000, + "webpage_url": "https://vimeo.com/188175573", + "timestamp": 1476968812, + "fulltitle": "Converse - Past meets Present - Montage", + "thumbnail": "https://i.vimeocdn.com/video/598160082_1280.jpg", + "webpage_url_basename": "188175573", + "_duration_raw": 29, + "_duration_hms": "00:00:29" +} diff --git a/packages/metascraper-media-provider/test/fixtures/youtube-dl.json b/packages/metascraper-media-provider/test/fixtures/youtube-dl.json deleted file mode 100644 index 118d0afd4..000000000 --- a/packages/metascraper-media-provider/test/fixtures/youtube-dl.json +++ /dev/null @@ -1,706 +0,0 @@ -{ - "upload_date": "20180813", - "creator": null, - "series": null, - "chapters": null, - "height": 720, - "like_count": 1225, - "duration": 284, - "id": "2hZDd4Yfhyw", - "requested_formats": [ - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "tbr": 2696.517, - "protocol": "https", - "format": "298 - 1280x720 (720p60)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=298&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184834230729&fvip=4&source=youtube&clen=30831030&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=3ED7C0216A6CBFD79647E8BD4E9463A955EB2E8D.4B933FF684BCA75D1E10C2771A101A646875F4BF&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "avc1.4d4020", - "format_note": "720p60", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "width": 1280, - "ext": "mp4", - "filesize": 30831030, - "fps": 60, - "format_id": "298", - "height": 720, - "quality": -1, - "acodec": "none" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "tbr": 127.913, - "container": "m4a_dash", - "format": "140 - audio only (DASH audio)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=140&mime=audio%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184829638266&fvip=4&source=youtube&clen=4509873&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=A906D1491BFCC44A63F6F2E65D4F54E6A212D341.97A0F255237A73DA79E95D77055B067644E714E8&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.910&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "none", - "format_note": "DASH audio", - "abr": 128, - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "ext": "m4a", - "filesize": 4509873, - "protocol": "https", - "format_id": "140", - "quality": -1, - "acodec": "mp4a.40.2" - } - ], - "view_count": 94812, - "playlist": null, - "title": "Ice Cube gives his take on whether LeBron James can achieve greatness in LA | First Take | ESPN", - "format": "298 - 1280x720 (720p60)+140 - audio only (DASH audio)", - "ext": "mp4", - "playlist_index": null, - "dislike_count": 66, - "average_rating": 4.79550743103, - "abr": 128, - "uploader_url": "http://www.youtube.com/user/ESPN", - "subtitles": {}, - "fps": 60, - "stretched_ratio": null, - "season_number": null, - "annotations": null, - "webpage_url_basename": "watch", - "acodec": "mp4a.40.2", - "display_id": "2hZDd4Yfhyw", - "automatic_captions": {}, - "description": "Ice Cube says that if LeBron James can win 4 ring in 4 years then he can be considered for the greatest in Los Angeles Lakers history, but he will be respected no matter what he does.\n\n✔ Subscribe to ESPN on YouTube: http://es.pn/SUBSCRIBEtoYOUTUBE\n✔ Subscribe to ESPN FC on YouTube: http://bit.ly/SUBSCRIBEtoESPNFC\n✔ Subscribe to NBA on ESPN on YouTube: http://bit.ly/SUBSCRIBEtoNBAonESPN\n✔ Watch ESPN on YouTube TV: http://es.pn/YouTubeTV\n\nESPN on Social Media:\n► Follow on Twitter: http://www.twitter.com/espn\n► Like on Facebook: http://www.facebook.com/espn\n► Follow on Instagram: http://www.instagram.com/espn\n\nVisit ESPN on YouTube to get up-to-the-minute sports news coverage, scores, highlights and commentary for NFL, NHL, MLB, NBA, College Football, NCAA Basketball, soccer and more.\n\nMore on ESPN.com: http://www.espn.com", - "tags": [ - "ice cube first take lebron james", - "ice cube first take espn", - "ice cube", - "ice cube first take", - "ice cube lebron james espn", - "ice cube on first take today", - "ice cube on first take", - "ice cube lebron james", - "first take ice cube", - "ice cube lebron james los angeles", - "ice cube on lebron james", - "ice cube lebron james lakers", - "ice cube on lebron to lakers", - "first take", - "stephen a smith", - "max kellerman", - "first take espn", - "espn first take", - "first take stephen a smith", - "espn" - ], - "track": null, - "requested_subtitles": null, - "start_time": null, - "uploader": "ESPN", - "format_id": "298+140", - "episode_number": null, - "uploader_id": "ESPN", - "categories": [ - "Sports" - ], - "thumbnails": [ - { - "url": "https://i.ytimg.com/vi/2hZDd4Yfhyw/hqdefault.jpg", - "id": "0" - } - ], - "license": null, - "alt_title": null, - "extractor_key": "Youtube", - "vcodec": "avc1.4d4020", - "artist": null, - "thumbnail": "https://i.ytimg.com/vi/2hZDd4Yfhyw/hqdefault.jpg", - "vbr": null, - "is_live": null, - "extractor": "youtube", - "end_time": null, - "webpage_url": "https://www.youtube.com/watch?v=2hZDd4Yfhyw", - "formats": [ - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "format_note": "DASH audio", - "protocol": "https", - "format": "249 - audio only (DASH audio)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=249&mime=audio%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185555220562&fvip=4&source=youtube&clen=1767940&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=491AFF87944CC9FD25B5D21C589F90377C3FCB3E.E05E599007F8D098CC04FAA293BAE8755110A4EB&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.861&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "none", - "tbr": 52.905, - "abr": 50, - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "ext": "webm", - "filesize": 1767940, - "format_id": "249", - "quality": -1, - "acodec": "opus" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "format_note": "DASH audio", - "protocol": "https", - "format": "250 - audio only (DASH audio)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=250&mime=audio%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185554470802&fvip=4&source=youtube&clen=2075656&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=26CBC1F3175DCD572EB2DE5551DF47DE6F38E953.2CD5A527DABFE81155C7F04C5FDE2F78C82C79C7&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.861&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "none", - "tbr": 67.232, - "abr": 70, - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "ext": "webm", - "filesize": 2075656, - "format_id": "250", - "quality": -1, - "acodec": "opus" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "format_note": "DASH audio", - "protocol": "https", - "format": "171 - audio only (DASH audio)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=171&mime=audio%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185555965278&fvip=4&source=youtube&clen=3312137&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=210B8EFBF6E1B837217E38F9A99C7377B489F24D.02B40582854DD3E3D2BE16CCB330B6B78F52F536&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.847&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "none", - "tbr": 103.254, - "abr": 128, - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "ext": "webm", - "filesize": 3312137, - "format_id": "171", - "quality": -1, - "acodec": "vorbis" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "format_note": "DASH audio", - "protocol": "https", - "format": "251 - audio only (DASH audio)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=251&mime=audio%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185555925305&fvip=4&source=youtube&clen=3710023&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=BBA4D9E803869BDFA4CA85AC3975A4E74F654DFC.C8B8D633CDAB9FE61DF583E8DBB9A2FF981C855B&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.861&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "none", - "tbr": 121.803, - "abr": 160, - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "ext": "webm", - "filesize": 3710023, - "format_id": "251", - "quality": -1, - "acodec": "opus" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "tbr": 127.913, - "container": "m4a_dash", - "format": "140 - audio only (DASH audio)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=140&mime=audio%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184829638266&fvip=4&source=youtube&clen=4509873&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=A906D1491BFCC44A63F6F2E65D4F54E6A212D341.97A0F255237A73DA79E95D77055B067644E714E8&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.910&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "none", - "format_note": "DASH audio", - "abr": 128, - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "ext": "m4a", - "filesize": 4509873, - "protocol": "https", - "format_id": "140", - "quality": -1, - "acodec": "mp4a.40.2" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "tbr": 96.238, - "container": "webm", - "format": "278 - 256x144 (144p)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=278&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185220177397&fvip=4&source=youtube&clen=3047257&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=31AEE690FC015CBF5606A0D9102FFC96B9BCA24B.2FF11959EEB4DE6777B07B938CE8057B30DD9648&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "vp9", - "format_note": "144p", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "width": 256, - "ext": "webm", - "filesize": 3047257, - "fps": 30, - "protocol": "https", - "format_id": "278", - "height": 144, - "quality": -1, - "acodec": "none" - }, - { - "format_note": "144p", - "protocol": "https", - "format": "160 - 256x144 (144p)", - "tbr": 104.641, - "height": 144, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "160", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=160&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184853954309&fvip=4&source=youtube&clen=1232192&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=B71A314816CBE56289EC15C8A1C6BF7EE74C169D.164175CF39A4BDFD2DA2DE6147BD09545AAA01DE&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "avc1.4d400c", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 256, - "ext": "mp4", - "filesize": 1232192, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "240p", - "protocol": "https", - "format": "133 - 426x240 (240p)", - "tbr": 191.392, - "height": 240, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "133", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=133&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184853956556&fvip=4&source=youtube&clen=2122314&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=E3307C18153DDB5E7AACAEAB9942F8B002012050.173DE890AE005232725CB8ADA7A50B7CF25692F0&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "avc1.4d4015", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 426, - "ext": "mp4", - "filesize": 2122314, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "240p", - "protocol": "https", - "format": "242 - 426x240 (240p)", - "tbr": 222.403, - "height": 240, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "242", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=242&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185220160992&fvip=4&source=youtube&clen=3850378&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=ADE29866D0E224F4FA327931066956085EDB8A01.473453C889918A9BB6E6B336A627D4D7B3F33824&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "vp9", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 426, - "ext": "webm", - "filesize": 3850378, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "360p", - "protocol": "https", - "format": "243 - 640x360 (360p)", - "tbr": 401.458, - "height": 360, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "243", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=243&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185220165648&fvip=4&source=youtube&clen=7618198&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=C5BE6688672F7461261A4254C66466434E6B9DD5.383565CD710DFB4CAAA0A895D3C4C58BD1685374&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "vp9", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 640, - "ext": "webm", - "filesize": 7618198, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "360p", - "protocol": "https", - "format": "134 - 640x360 (360p)", - "tbr": 471.132, - "height": 360, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "134", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=134&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184854055225&fvip=4&source=youtube&clen=5015666&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=3DEFAB448DC70677960CAF56B11FB769592FC440.5CD5B13E517668562CCE3F430CF16734E3DD63CA&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "avc1.4d401e", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 640, - "ext": "mp4", - "filesize": 5015666, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "480p", - "protocol": "https", - "format": "244 - 854x480 (480p)", - "tbr": 757.845, - "height": 480, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "244", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=244&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185220165309&fvip=4&source=youtube&clen=13504592&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=8BE1DAB5B67AEAEDDEC26141F4EB2323434677F9.40D8005C9A361EA5C6FA16BBE4EE5C03D692FD8E&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "vp9", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 854, - "ext": "webm", - "filesize": 13504592, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "480p", - "protocol": "https", - "format": "135 - 854x480 (480p)", - "tbr": 900.881, - "height": 480, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "135", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=135&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184854155850&fvip=4&source=youtube&clen=9629112&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=B4B7A543DEAEEF890B8E6D2DCD83F8F07633DA9F.503058111885647E7E14FA29CA781D0AC0EACA6D&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "avc1.4d401f", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 854, - "ext": "mp4", - "filesize": 9629112, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "720p", - "protocol": "https", - "format": "247 - 1280x720 (720p)", - "tbr": 1463.626, - "height": 720, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "247", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=247&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185220174836&fvip=4&source=youtube&clen=29547867&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=4EB17F5834B600075C7EB219E5876609A1FFC932.75C777BD0FC651CF34137FF53964B03149CA5C49&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "vp9", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 1280, - "ext": "webm", - "filesize": 29547867, - "fps": 30, - "acodec": "none" - }, - { - "format_note": "720p", - "protocol": "https", - "format": "136 - 1280x720 (720p)", - "tbr": 1592.796, - "height": 720, - "downloader_options": { - "http_chunk_size": 10485760 - }, - "format_id": "136", - "quality": -1, - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=136&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184854254121&fvip=4&source=youtube&clen=18536895&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=15992BA735625E478060A1DFD9C01D00C0702BE4.C887CC9578BFCBE0ABF4FFCA47139C40B07436E3&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "avc1.4d401f", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 1280, - "ext": "mp4", - "filesize": 18536895, - "fps": 30, - "acodec": "none" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "tbr": 2586.548, - "protocol": "https", - "format": "302 - 1280x720 (720p60)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=302&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185013746111&fvip=4&source=youtube&clen=41986806&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=46D6B16D847DEF9A654E8E15E805A488D348A2AF.3D6F1BA63D1AE2CA7736A59F18CCCF80C9003854&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.849&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "vp9", - "format_note": "720p60", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "width": 1280, - "ext": "webm", - "filesize": 41986806, - "fps": 60, - "format_id": "302", - "height": 720, - "quality": -1, - "acodec": "none" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "tbr": 2696.517, - "protocol": "https", - "format": "298 - 1280x720 (720p60)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=298&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C302&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534184834230729&fvip=4&source=youtube&clen=30831030&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&keepalive=yes&signature=3ED7C0216A6CBFD79647E8BD4E9463A955EB2E8D.4B933FF684BCA75D1E10C2771A101A646875F4BF&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.850&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "avc1.4d4020", - "format_note": "720p60", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "downloader_options": { - "http_chunk_size": 10485760 - }, - "width": 1280, - "ext": "mp4", - "filesize": 30831030, - "fps": 60, - "format_id": "298", - "height": 720, - "quality": -1, - "acodec": "none" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "protocol": "https", - "format": "17 - 176x144 (small)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=17&mime=video%2F3gpp&pl=20&expire=1534224522&mv=m&lmt=1534184587965484&fvip=4&source=youtube&clen=2893543&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&signature=8035AFAEEB9BE2736E041BB5B907F28F881CB218.CAA02DA4FA239160EE8B3F091884A7EFC53B93EC&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.933&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "mp4v.20.3", - "format_note": "small", - "ext": "3gp", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 176, - "abr": 24, - "filesize": 2893543, - "format_id": "17", - "height": 144, - "resolution": "176x144", - "acodec": "mp4a.40.2" - }, - { - "protocol": "https", - "format": "36 - 320x180 (small)", - "format_note": "small", - "height": 180, - "format_id": "36", - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=36&mime=video%2F3gpp&pl=20&expire=1534224522&mv=m&lmt=1534184588565234&fvip=4&source=youtube&clen=7869391&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&signature=12F4A55FD6D6D2484F0FD0BF775EEA23D3E97639.D1B15C0BBCDAD61CBDD72D5695B2FE3B8C4668D8&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&dur=283.933&ei=KhRyW4nkJIvkV7yXvugN&ratebypass=yes", - "vcodec": "mp4v.20.3", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 320, - "ext": "3gp", - "filesize": 7869391, - "resolution": "320x180", - "acodec": "mp4a.40.2" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "protocol": "https", - "format": "18 - 640x360 (medium)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=18&mime=video%2Fmp4&pl=20&expire=1534224522&mv=m&lmt=1534185137343773&fvip=4&source=youtube&clen=14141551&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&ratebypass=yes&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&signature=250354E58D1DBCA03CBD4DC9E3FB244C5E1152A0.952F5690B6C36A18ADEA9DDA89ED78148CAFA2A4&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&dur=283.910&ei=KhRyW4nkJIvkV7yXvugN", - "quality": 1, - "vcodec": "avc1.42001E", - "format_note": "medium", - "ext": "mp4", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 640, - "abr": 96, - "filesize": 14141551, - "format_id": "18", - "height": 360, - "resolution": "640x360", - "acodec": "mp4a.40.2" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "protocol": "https", - "format": "43 - 640x360 (medium)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=43&mime=video%2Fwebm&pl=20&expire=1534224522&mv=m&lmt=1534185610458623&fvip=4&source=youtube&clen=22258178&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&ratebypass=yes&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mm=31%2C29&c=WEB&key=yt6&ip=95.17.206.54&signature=DA20EA5896E4F5E5B2F2B026BE63DF56AC4D5CF1.77668799BD2EB81CEBD00EA8F6191F3419947357&initcwndbps=928750&gir=yes&mt=1534202758&ms=au%2Crdu&ipbits=0&requiressl=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&dur=0.000&ei=KhRyW4nkJIvkV7yXvugN", - "quality": 1, - "vcodec": "vp8.0", - "format_note": "medium", - "ext": "webm", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 640, - "abr": 128, - "filesize": 22258178, - "format_id": "43", - "height": 360, - "resolution": "640x360", - "acodec": "vorbis" - }, - { - "http_headers": { - "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", - "Accept-Language": "en-us,en;q=0.5", - "Accept-Encoding": "gzip, deflate", - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 (Chrome)" - }, - "protocol": "https", - "format": "22 - 1280x720 (hd720)", - "url": "https://r6---sn-w511uxa-8aje.googlevideo.com/videoplayback?itag=22&mm=31%2C29&c=WEB&mn=sn-w511uxa-8aje%2Csn-h5q7knez&mime=video%2Fmp4&ip=95.17.206.54&pl=20&signature=26B8FCB51DC7903132039080C3888D83EC65E0F1.07B5FDE4D99FF3C3354D4D164FBC3CA838F6DEFF&expire=1534224522&initcwndbps=928750&mv=m&mt=1534202758&ms=au%2Crdu&ipbits=0&lmt=1534185082305521&requiressl=yes&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&source=youtube&ratebypass=yes&dur=283.910&id=o-AH-F7AllkKVHynK8qqnw4B_x0q76t92S_pPhPul-9lU7&key=yt6&ei=KhRyW4nkJIvkV7yXvugN&fvip=4", - "quality": 2, - "vcodec": "avc1.64001F", - "format_note": "hd720", - "ext": "mp4", - "player_url": "/yts/jsbin/player-vflM-t6FF/en_US/base.js", - "width": 1280, - "abr": 192, - "format_id": "22", - "height": 720, - "resolution": "1280x720", - "acodec": "mp4a.40.2" - } - ], - "resolution": null, - "width": 1280, - "age_limit": 0 -} diff --git a/packages/metascraper-media-provider/test/fixtures/youtube.json b/packages/metascraper-media-provider/test/fixtures/youtube.json new file mode 100644 index 000000000..c5b3bfdff --- /dev/null +++ b/packages/metascraper-media-provider/test/fixtures/youtube.json @@ -0,0 +1,654 @@ +{ + "upload_date": "20170414", + "protocol": "https", + "creator": null, + "series": null, + "format_note": "hd720", + "chapters": null, + "height": 720, + "like_count": 7501, + "duration": "2:22", + "fulltitle": "Star Wars 8 THE LAST JEDI Official TRAILER (2017) Daisy Ridley, Disney Movie HD", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "quality": 2, + "id": "hwMkbaS_M_c", + "view_count": 1075290, + "playlist": null, + "title": "Star Wars 8 THE LAST JEDI Official TRAILER (2017) Daisy Ridley, Disney Movie HD", + "_filename": "Star Wars 8 THE LAST JEDI Official TRAILER (2017) Daisy Ridley, Disney Movie HD-hwMkbaS_M_c.mp4", + "format": "22 - 1280x720 (hd720)", + "ext": "mp4", + "playlist_index": null, + "dislike_count": 525, + "average_rating": 4.73835039139, + "abr": 192, + "uploader_url": "http://www.youtube.com/user/movietrailers", + "subtitles": {}, + "season_number": null, + "annotations": null, + "webpage_url_basename": "watch", + "acodec": "mp4a.40.2", + "display_id": "hwMkbaS_M_c", + "automatic_captions": {}, + "description": "Star Wars 8 THE LAST JEDI Official TRAILER (2017) Daisy Ridley, Disney Movie HD\n© 2017 - Disney", + "tags": [ + "Official", + "Trailer", + "Movie", + "Clip", + "TV Spot", + "International", + "Film", + "Star Wars 8", + "THE LAST JEDI", + "Star Wars THE LAST JEDI" + ], + "track": null, + "requested_subtitles": null, + "start_time": null, + "uploader": "ONE Media", + "format_id": "22", + "episode_number": null, + "uploader_id": "movietrailers", + "categories": [ + "Film & Animation" + ], + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "thumbnails": [ + { + "url": "https://i.ytimg.com/vi/hwMkbaS_M_c/maxresdefault.jpg", + "id": "0" + } + ], + "license": null, + "alt_title": null, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?fvip=3&mime=video%2Fmp4&ipbits=0&lmt=1507953047549769&ratebypass=yes&key=yt6&requiressl=yes&c=WEB&expire=1535818875&ei=G2iKW_jiIMTjV6OjsqgF&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=22&source=youtube&dur=141.502&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&mt=1535797130&signature=1CE1646A209F0D00E8DD16784BAFCD9E0C9CF06C.0EF24C1CBF4A06AFEB7F404C3E28CE35B354F384", + "extractor_key": "Youtube", + "vcodec": "avc1.64001F", + "artist": null, + "thumbnail": "https://i.ytimg.com/vi/hwMkbaS_M_c/maxresdefault.jpg", + "is_live": null, + "extractor": "youtube", + "end_time": null, + "webpage_url": "https://www.youtube.com/watch?v=hwMkbaS_M_c", + "formats": [ + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "format_note": "DASH audio", + "protocol": "https", + "format": "249 - audio only (DASH audio)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=audio%2Fwebm&gir=yes&ipbits=0&lmt=1503812236172843&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=249&mt=1535797130&dur=141.441&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=767256&signature=37EFCDA1816850D5475935E19742607B798823AC.D68C8173223386C5CDC7270DFAFE8A89427C0A4E&ratebypass=yes", + "vcodec": "none", + "tbr": 56.647, + "abr": 50, + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "downloader_options": { + "http_chunk_size": 10485760 + }, + "ext": "webm", + "filesize": 767256, + "format_id": "249", + "quality": -1, + "acodec": "opus" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "format_note": "DASH audio", + "protocol": "https", + "format": "250 - audio only (DASH audio)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=audio%2Fwebm&gir=yes&ipbits=0&lmt=1503812231569091&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=250&mt=1535797130&dur=141.441&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=1012417&signature=6EBF894E981A5348F6F460E4E4159B3C8AAB251F.BF73ECF1C1816183AE22FFF93AA158FB8AE8AFEE&ratebypass=yes", + "vcodec": "none", + "tbr": 73.815, + "abr": 70, + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "downloader_options": { + "http_chunk_size": 10485760 + }, + "ext": "webm", + "filesize": 1012417, + "format_id": "250", + "quality": -1, + "acodec": "opus" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "tbr": 128.211, + "container": "m4a_dash", + "format": "140 - audio only (DASH audio)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=audio%2Fmp4&gir=yes&ipbits=0&lmt=1507952811949144&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=140&mt=1535797130&dur=141.502&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=2248120&signature=E3942E3A3682B75BD7ADA0D3B23D839993029231.CA74D985A1158F2EAD22633C998E28A30F5F28A2&ratebypass=yes", + "vcodec": "none", + "format_note": "DASH audio", + "abr": 128, + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "downloader_options": { + "http_chunk_size": 10485760 + }, + "ext": "m4a", + "filesize": 2248120, + "protocol": "https", + "format_id": "140", + "quality": -1, + "acodec": "mp4a.40.2" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "format_note": "DASH audio", + "protocol": "https", + "format": "171 - audio only (DASH audio)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=audio%2Fwebm&gir=yes&ipbits=0&lmt=1503812242728751&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=171&mt=1535797130&dur=141.437&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=1855487&signature=5FB40BEB02901583FCF198CBA5173E5BE8406DA3.89DC7C6DE72A0913447FAD3AB2F99F2A0C30BCC7&ratebypass=yes", + "vcodec": "none", + "tbr": 136.226, + "abr": 128, + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "downloader_options": { + "http_chunk_size": 10485760 + }, + "ext": "webm", + "filesize": 1855487, + "format_id": "171", + "quality": -1, + "acodec": "vorbis" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "format_note": "DASH audio", + "protocol": "https", + "format": "251 - audio only (DASH audio)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=audio%2Fwebm&gir=yes&ipbits=0&lmt=1503812234640643&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=251&mt=1535797130&dur=141.441&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=1973587&signature=A4A70B7B131A1F83908D54FA680B1F0311F90726.A540C3075E6F9C7FBAE1D7258A8497335AB4C3FA&ratebypass=yes", + "vcodec": "none", + "tbr": 139.028, + "abr": 160, + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "downloader_options": { + "http_chunk_size": 10485760 + }, + "ext": "webm", + "filesize": 1973587, + "format_id": "251", + "quality": -1, + "acodec": "opus" + }, + { + "format_note": "144p", + "protocol": "https", + "format": "160 - 256x144 (144p)", + "tbr": 103.817, + "height": 144, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "160", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889801167&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=160&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=503873&signature=5CCB9E814DC47000AE95012B9BAC5E638CF7B335.AEBC98B5759C5A7B2BFCD057539543D7FF3F0682&ratebypass=yes", + "vcodec": "avc1.4d400c", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 256, + "ext": "mp4", + "filesize": 503873, + "fps": 25, + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "tbr": 113.715, + "container": "webm", + "format": "278 - 256x144 (144p)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fwebm&gir=yes&ipbits=0&lmt=1503812681501403&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=278&mt=1535797130&dur=141.400&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=1069403&signature=7D7393720C189DC68DF0A30D394962A443810F61.41AAC16433B25DED2AEA16961ACDA99217ED3FB3&ratebypass=yes", + "vcodec": "vp9", + "format_note": "144p", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "downloader_options": { + "http_chunk_size": 10485760 + }, + "width": 256, + "ext": "webm", + "filesize": 1069403, + "fps": 25, + "protocol": "https", + "format_id": "278", + "height": 144, + "quality": -1, + "acodec": "none" + }, + { + "format_note": "240p", + "protocol": "https", + "format": "133 - 426x240 (240p)", + "tbr": 195.762, + "height": 240, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "133", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889799661&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=133&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=916551&signature=CB679D12966286AEDBC316AF52CB1502D31252C6.28D58615691F9E540559B860B5719E7A55C90BC0&ratebypass=yes", + "vcodec": "avc1.4d4015", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 426, + "ext": "mp4", + "filesize": 916551, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "240p", + "protocol": "https", + "format": "242 - 426x240 (240p)", + "tbr": 208.406, + "height": 240, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "242", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fwebm&gir=yes&ipbits=0&lmt=1503812681641246&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=242&mt=1535797130&dur=141.400&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=1328857&signature=6599D459FC9B49A50485711E1C335653532B35D5.A2CD851AC2535957714881682AB07D1DC317F490&ratebypass=yes", + "vcodec": "vp9", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 426, + "ext": "webm", + "filesize": 1328857, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "360p", + "protocol": "https", + "format": "243 - 640x360 (360p)", + "tbr": 387.135, + "height": 360, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "243", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fwebm&gir=yes&ipbits=0&lmt=1503812681686904&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=243&mt=1535797130&dur=141.400&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=2492253&signature=1FF8110CB9D75C4A8FB282C6806A5A71F6A9BF86.63C626C127A699E1854F0571712491E0D3DDBF84&ratebypass=yes", + "vcodec": "vp9", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 640, + "ext": "webm", + "filesize": 2492253, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "360p", + "protocol": "https", + "format": "134 - 640x360 (360p)", + "tbr": 463.236, + "height": 360, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "134", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889802693&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=134&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=2207390&signature=90CC91716540A24CFC117B94831E34CBF2E11519.1253E700A2076681949A8077EF0A0CC13EE0A70A&ratebypass=yes", + "vcodec": "avc1.4d401e", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 640, + "ext": "mp4", + "filesize": 2207390, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "480p", + "protocol": "https", + "format": "244 - 854x480 (480p)", + "tbr": 663.803, + "height": 480, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "244", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fwebm&gir=yes&ipbits=0&lmt=1503812682913964&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=244&mt=1535797130&dur=141.400&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=4032317&signature=539A0FB04E19D118BA1B236C5F5C1FDE7077810B.B6F322E499368273C442D243E9DB905F52B69F23&ratebypass=yes", + "vcodec": "vp9", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 854, + "ext": "webm", + "filesize": 4032317, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "480p", + "protocol": "https", + "format": "135 - 854x480 (480p)", + "tbr": 893.337, + "height": 480, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "135", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952889999957&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=135&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=4380005&signature=20C47063DBB07F696EA3ADDB14B9127CB5C5CB3A.B722ED0B37D06C014D5747F1481559B0D0B36D66&ratebypass=yes", + "vcodec": "avc1.4d401e", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 854, + "ext": "mp4", + "filesize": 4380005, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "720p", + "protocol": "https", + "format": "247 - 1280x720 (720p)", + "tbr": 1353.112, + "height": 720, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "247", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fwebm&gir=yes&ipbits=0&lmt=1503812680723992&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=247&mt=1535797130&dur=141.400&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=8034497&signature=451EBFD73FA768FAF6B3F7F80C7D2D76DC69BB7D.242C2C43191B2310203D3DE6F8BF495EAC8C1645&ratebypass=yes", + "vcodec": "vp9", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 1280, + "ext": "webm", + "filesize": 8034497, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "720p", + "protocol": "https", + "format": "136 - 1280x720 (720p)", + "tbr": 1610.767, + "height": 720, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "136", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952890403137&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=136&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=8054202&signature=2B28B5EC1C1EE32C0BE79537EE448B1BF0441A57.09D9F53E9F626EB8DB06508DCA3AA28B4C89D183&ratebypass=yes", + "vcodec": "avc1.4d401f", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 1280, + "ext": "mp4", + "filesize": 8054202, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "1080p", + "protocol": "https", + "format": "248 - 1920x1080 (1080p)", + "tbr": 2347.36, + "height": 1080, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "248", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fwebm&gir=yes&ipbits=0&lmt=1503812340015025&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=248&mt=1535797130&dur=141.400&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=15062619&signature=D8366E08756AE8B241DD5264ECE8928F03ACD759.61D7374624D57DA33C551EA94285CB566FDE8C89&ratebypass=yes", + "vcodec": "vp9", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 1920, + "ext": "webm", + "filesize": 15062619, + "fps": 25, + "acodec": "none" + }, + { + "format_note": "1080p", + "protocol": "https", + "format": "137 - 1920x1080 (1080p)", + "tbr": 2757.086, + "height": 1080, + "downloader_options": { + "http_chunk_size": 10485760 + }, + "format_id": "137", + "quality": -1, + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?keepalive=yes&fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1507952977382584&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=137&mt=1535797130&dur=141.440&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&clen=14903843&signature=16960EBA740BA2C11F88FC697A42F7D0E52EA2EC.4AC8D17A3BED6B6E68AB92CFE3F598341A9D839A&ratebypass=yes", + "vcodec": "avc1.640028", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 1920, + "ext": "mp4", + "filesize": 14903843, + "fps": 25, + "acodec": "none" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "17 - 176x144 (small)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?fvip=3&mime=video%2F3gpp&gir=yes&ipbits=0&lmt=1503811657072536&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=17&mt=1535797130&dur=141.548&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=1187373&signature=4325E9F4DAC37FB0D61B0015DC0636E753C2C5E1.2A9BC9E6B8C94607A012EFCD3A2A134E807F25C3&ratebypass=yes", + "vcodec": "mp4v.20.3", + "format_note": "small", + "ext": "3gp", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 176, + "abr": 24, + "filesize": 1187373, + "format_id": "17", + "height": 144, + "resolution": "176x144", + "acodec": "mp4a.40.2" + }, + { + "protocol": "https", + "format": "36 - 320x180 (small)", + "format_note": "small", + "height": 180, + "format_id": "36", + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?fvip=3&mime=video%2F3gpp&gir=yes&ipbits=0&lmt=1503811652398125&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=36&mt=1535797130&dur=141.548&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=3506033&signature=19E76DBDC1137B269267DAD172E63FB137D5EEC7.3578D812A3DFB2651B4E51522B948F1976299462&ratebypass=yes", + "vcodec": "mp4v.20.3", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 320, + "ext": "3gp", + "filesize": 3506033, + "resolution": "320x180", + "acodec": "mp4a.40.2" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "18 - 640x360 (medium)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?fvip=3&mime=video%2Fmp4&gir=yes&ipbits=0&lmt=1503811655561063&ratebypass=yes&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=18&mt=1535797130&dur=141.502&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=6322851&signature=098FAC77C4F9A641DF056D470EBE5A4D100FB915.47064BC9130CF024C716B65E414864B88DED5FC0", + "quality": 1, + "vcodec": "avc1.42001E", + "format_note": "medium", + "ext": "mp4", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 640, + "abr": 96, + "filesize": 6322851, + "format_id": "18", + "height": 360, + "resolution": "640x360", + "acodec": "mp4a.40.2" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "43 - 640x360 (medium)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?fvip=3&mime=video%2Fwebm&gir=yes&ipbits=0&lmt=1503812251410108&ratebypass=yes&expire=1535818875&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=43&mt=1535797130&dur=0.000&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ei=G2iKW_jiIMTjV6OjsqgF&key=yt6&requiressl=yes&c=WEB&source=youtube&clen=7126000&signature=2457DCD9E41AC8777B9BA0815AFB014BC644CD20.72712447936DB69925B02DEACF6576B9B568F4D4", + "quality": 1, + "vcodec": "vp8.0", + "format_note": "medium", + "ext": "webm", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 640, + "abr": 128, + "filesize": 7126000, + "format_id": "43", + "height": 360, + "resolution": "640x360", + "acodec": "vorbis" + }, + { + "http_headers": { + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Accept-Language": "en-us,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0" + }, + "protocol": "https", + "format": "22 - 1280x720 (hd720)", + "url": "https://r3---sn-aigl6nek.googlevideo.com/videoplayback?fvip=3&mime=video%2Fmp4&ipbits=0&lmt=1507953047549769&ratebypass=yes&key=yt6&requiressl=yes&c=WEB&expire=1535818875&ei=G2iKW_jiIMTjV6OjsqgF&pl=24&mm=31%2C26&ip=95.131.170.224&mn=sn-aigl6nek%2Csn-4g5ednss&initcwndbps=301250&ms=au%2Conr&itag=22&source=youtube&dur=141.502&mv=m&id=o-AMQjKkqESQJsZjtvcGYi-wuToRTYpm-mUp5Ck3IHofXM&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&mt=1535797130&signature=1CE1646A209F0D00E8DD16784BAFCD9E0C9CF06C.0EF24C1CBF4A06AFEB7F404C3E28CE35B354F384", + "quality": 2, + "vcodec": "avc1.64001F", + "format_note": "hd720", + "ext": "mp4", + "player_url": "/yts/jsbin/player-vfliK45Zi/en_US/base.js", + "width": 1280, + "abr": 192, + "format_id": "22", + "height": 720, + "resolution": "1280x720", + "acodec": "mp4a.40.2" + } + ], + "resolution": "1280x720 (hd720)", + "width": 1280, + "age_limit": 0, + "_duration_raw": 142, + "_duration_hms": "00:02:22" +} diff --git a/packages/metascraper-media-provider/test/index.js b/packages/metascraper-media-provider/test/index.js index 91e15a474..a05f141e4 100644 --- a/packages/metascraper-media-provider/test/index.js +++ b/packages/metascraper-media-provider/test/index.js @@ -1,79 +1,66 @@ 'use strict' -const { isUrl } = require('@metascraper/helpers') -const { isString } = require('lodash') const snapshot = require('snap-shot') const { promisify } = require('util') const { resolve } = require('path') -const { omit } = require('lodash') -const should = require('should') const fs = require('fs') const metascraper = require('metascraper')([ - require('metascraper-media-provider')(), + require('metascraper-publisher')(), + require('..')(), require('metascraper-author')(), require('metascraper-date')(), require('metascraper-description')(), require('metascraper-image')(), require('metascraper-lang')(), require('metascraper-logo')(), - require('metascraper-publisher')(), require('metascraper-title')(), require('metascraper-url')() ]) const readFile = promisify(fs.readFile) -const { getVideo } = require('metascraper-media-provider') - -const output = require('./fixtures/youtube-dl.json') +const { getVideo } = require('..') describe('metascraper-media-provider', () => { - it('.getVideo', () => { - snapshot(getVideo(output.formats)) + describe('.getVideo', () => { + it('twitter', () => { + snapshot(getVideo(require('./fixtures/twitter.json'))) + }) + it('vimeo', () => { + snapshot(getVideo(require('./fixtures/vimeo.json'))) + }) + it('youtube', () => { + snapshot(getVideo(require('./fixtures/youtube.json'))) + }) }) describe('provider', () => { it('vimeo', async () => { const html = await readFile(resolve(__dirname, 'fixtures/vimeo.html')) const url = 'https://vimeo.com/188175573' const metadata = await metascraper({ html, url }) - should(isUrl(metadata.video)).be.true() - should(isString(metadata.title)).be.true() - const meta = omit(metadata, ['video', 'title']) - snapshot(meta) + snapshot(metadata) }) it('twitter', async () => { const html = await readFile(resolve(__dirname, 'fixtures/twitter.html')) const url = 'https://twitter.com/verge/status/957383241714970624' - const metadata = await metascraper({ html, url }) - should(isUrl(metadata.video)).be.true() - should(isString(metadata.title)).be.true() - const meta = omit(metadata, ['video', 'title']) - snapshot(meta) + snapshot(metadata) }) it('facebook', async () => { const html = await readFile(resolve(__dirname, 'fixtures/facebook.html')) const url = 'https://www.facebook.com/afcajax/videos/1686831701364171' - const metadata = await metascraper({ html, url }) - should(isUrl(metadata.video)).be.true() - should(isString(metadata.title)).be.true() - const meta = omit(metadata, ['video', 'title']) - snapshot(meta) + snapshot(metadata) }) it('youtube', async () => { const html = await readFile(resolve(__dirname, 'fixtures/youtube.html')) const url = 'https://www.youtube.com/watch?v=hwMkbaS_M_c' - const metadata = await metascraper({ html, url }) - should(isUrl(metadata.video)).be.true() - should(isString(metadata.title)).be.true() - const meta = omit(metadata, ['video', 'title']) - snapshot(meta) + snapshot(metadata) }) }) }) diff --git a/packages/metascraper-publisher/index.js b/packages/metascraper-publisher/index.js index c1989fcb1..5df295de9 100644 --- a/packages/metascraper-publisher/index.js +++ b/packages/metascraper-publisher/index.js @@ -1,13 +1,10 @@ 'use strict' -const { isString } = require('lodash') -const condenseWhitespace = require('condense-whitespace') +const { publisher } = require('@metascraper/helpers') const REGEX_RSS = /^(.*?)\s[-|]\satom$/i const REGEX_TITLE = /^.*?[-|]\s+(.*)$/ -const validator = value => isString(value) && condenseWhitespace(value) - /** * Wrap a rule with validation and formatting logic. * @@ -17,7 +14,7 @@ const validator = value => isString(value) && condenseWhitespace(value) const wrap = rule => ({ htmlDom }) => { const value = rule(htmlDom) - return validator(value) + return publisher(value) } const getFromTitle = (text, regex) => { @@ -53,5 +50,3 @@ module.exports = () => ({ wrap($ => getFromTitle($('link[type*="xml"]').attr('title'), REGEX_RSS)) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-publisher/package.json b/packages/metascraper-publisher/package.json index e189793ba..1bf7a57c5 100644 --- a/packages/metascraper-publisher/package.json +++ b/packages/metascraper-publisher/package.json @@ -16,8 +16,7 @@ "url": "https://github.com/microlinkhq/metascraper/issues" }, "dependencies": { - "condense-whitespace": "~1.0.0", - "lodash": "~4.17.10" + "@metascraper/helpers": "^4.0.1" }, "devDependencies": { "mocha": "latest", diff --git a/packages/metascraper-soundcloud/index.js b/packages/metascraper-soundcloud/index.js index adb893b8e..1bb87fc6d 100644 --- a/packages/metascraper-soundcloud/index.js +++ b/packages/metascraper-soundcloud/index.js @@ -1,19 +1,19 @@ 'use strict' -const {getValue, titleize} = require('@metascraper/helpers') +const { $filter, title } = require('@metascraper/helpers') module.exports = () => ({ author: [ - ({htmlDom: $, meta, url: baseUrl}) => - titleize(getValue($, $('.soundTitle__username'))) + ({ htmlDom: $, meta, url: baseUrl }) => + title($filter($, $('.soundTitle__username'))) ], description: [ - ({htmlDom: $, meta, url: baseUrl}) => - titleize( + ({ htmlDom: $, meta, url: baseUrl }) => + title( $('.soundTitle__description') .first() .text(), - {capitalize: false} + { capitalize: false } ) ] }) diff --git a/packages/metascraper-title/index.js b/packages/metascraper-title/index.js index 347f9fed4..6cf49fcdc 100644 --- a/packages/metascraper-title/index.js +++ b/packages/metascraper-title/index.js @@ -1,13 +1,10 @@ 'use strict' -const { getValue, titleize } = require('@metascraper/helpers') -const { isString } = require('lodash') - -const validator = value => isString(value) && titleize(value) +const { $filter, title } = require('@metascraper/helpers') const wrap = rule => ({ htmlDom }) => { const value = rule(htmlDom) - return validator(value) + return title(value) } module.exports = () => ({ @@ -18,8 +15,6 @@ module.exports = () => ({ wrap($ => $('.entry-title').text()), wrap($ => $('h1[class*="title"] a').text()), wrap($ => $('h1[class*="title"]').text()), - wrap($ => getValue($, $('title'))) + wrap($ => $filter($, $('title'))) ] }) - -module.exports.validator = wrap diff --git a/packages/metascraper-url/index.js b/packages/metascraper-url/index.js index 89ed09a46..cfb6ae025 100644 --- a/packages/metascraper-url/index.js +++ b/packages/metascraper-url/index.js @@ -1,8 +1,6 @@ 'use strict' -const { getUrl, isUrl } = require('@metascraper/helpers') - -const validator = (value, url) => isUrl(value) && getUrl(url, value) +const { url: urlFn } = require('@metascraper/helpers') /** * Wrap a rule with validation and formatting logic. @@ -13,7 +11,7 @@ const validator = (value, url) => isUrl(value) && getUrl(url, value) const wrap = rule => ({ htmlDom, url }) => { const value = rule(htmlDom) - return validator(value, url) + return urlFn(value, { url }) } /** @@ -29,5 +27,3 @@ module.exports = () => ({ ({ url }) => url ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-video/index.js b/packages/metascraper-video/index.js index 478a0e0bf..78b45c3fe 100644 --- a/packages/metascraper-video/index.js +++ b/packages/metascraper-video/index.js @@ -1,15 +1,6 @@ 'use strict' -const { getUrl, isUrl } = require('@metascraper/helpers') -const videoExtensions = require('video-extensions') -const { URL } = require('url') -const path = require('path') - -const isVideoUrl = url => { - const { pathname } = new URL(url) - const ext = path.extname(pathname).substring(1) - return videoExtensions.includes(ext) -} +const { url: urlFn, isVideoUrl } = require('@metascraper/helpers') /** * Wrap a rule with validation and formatting logic. @@ -23,24 +14,19 @@ const createWrapper = fn => rule => ({ htmlDom, url }) => { return fn(value, url) } -const wrap = createWrapper((value, url) => isUrl(value) && getUrl(url, value)) +const wrap = createWrapper((value, url) => urlFn(value, { url })) -const validator = (value, url) => { - if (!isUrl(value)) return false - const urlValue = getUrl(url, value) +const wrapVideo = createWrapper((value, url) => { + const urlValue = urlFn(value, { url }) return isVideoUrl(urlValue) && urlValue -} - -const wrapVideo = createWrapper(validator) +}) /** * Rules. */ module.exports = () => ({ - image: [ - wrap($ => $('video').attr('poster')) - ], + image: [wrap($ => $('video').attr('poster'))], video: [ wrapVideo($ => $('meta[property="og:video:secure_url"]').attr('content')), wrapVideo($ => $('meta[property="og:video:url"]').attr('content')), @@ -50,5 +36,3 @@ module.exports = () => ({ wrapVideo($ => $('source').attr('src')) ] }) - -module.exports.validator = validator diff --git a/packages/metascraper-video/package.json b/packages/metascraper-video/package.json index 091bd7caf..32d2dd700 100644 --- a/packages/metascraper-video/package.json +++ b/packages/metascraper-video/package.json @@ -16,8 +16,7 @@ "url": "https://github.com/microlinkhq/metascraper/issues" }, "dependencies": { - "@metascraper/helpers": "^4.0.1", - "video-extensions": "~1.1.0" + "@metascraper/helpers": "^4.0.1" }, "devDependencies": { "lodash": "latest", diff --git a/packages/metascraper-video/test/index.js b/packages/metascraper-video/test/index.js index 437dacf43..7a25274b2 100644 --- a/packages/metascraper-video/test/index.js +++ b/packages/metascraper-video/test/index.js @@ -7,7 +7,7 @@ const { omit } = require('lodash') const fs = require('fs') const metascraper = require('metascraper')([ - require('metascraper-video')(), + require('..')(), require('metascraper-author')(), require('metascraper-date')(), require('metascraper-description')(), diff --git a/packages/metascraper-youtube/index.js b/packages/metascraper-youtube/index.js index e2fded236..e2a310fbb 100644 --- a/packages/metascraper-youtube/index.js +++ b/packages/metascraper-youtube/index.js @@ -1,10 +1,8 @@ 'use strict' -const getVideoId = require('get-video-id') - -const { getValue, isUrl, titleize } = require('@metascraper/helpers') +const { $filter, author } = require('@metascraper/helpers') const isReachable = require('is-reachable') -const { isString } = require('lodash') +const getVideoId = require('get-video-id') const pLocate = require('p-locate') const THUMBAILS_RESOLUTIONS = [ @@ -16,29 +14,27 @@ const THUMBAILS_RESOLUTIONS = [ ] const getThumbnailUrl = id => { - const urls = THUMBAILS_RESOLUTIONS.map(res => `https://img.youtube.com/vi/${id}/${res}`) + const urls = THUMBAILS_RESOLUTIONS.map( + res => `https://img.youtube.com/vi/${id}/${res}` + ) return pLocate(urls, isReachable) } const wrap = rule => ({ htmlDom }) => { const value = rule(htmlDom) - return isString(value) && !isUrl(value, {relative: false}) && titleize( - value, {removeBy: true} - ) + return author(value) } module.exports = () => ({ author: [ wrap($ => $('#owner-name').text()), wrap($ => $('#channel-title').text()), - wrap($ => getValue($, $('[class*="user-info"]'))) - ], - publisher: [ - ({url}) => getVideoId(url).service === 'youtube' && 'YouTube' + wrap($ => $filter($, $('[class*="user-info"]'))) ], + publisher: [({ url }) => getVideoId(url).service === 'youtube' && 'YouTube'], image: [ ({ htmlDom, url }) => { - const {id, service} = getVideoId(url) + const { id, service } = getVideoId(url) return service === 'youtube' && id && getThumbnailUrl(id) } ] diff --git a/packages/metascraper-youtube/package.json b/packages/metascraper-youtube/package.json index a42cb1dce..e5098a0e6 100644 --- a/packages/metascraper-youtube/package.json +++ b/packages/metascraper-youtube/package.json @@ -24,7 +24,6 @@ "@metascraper/helpers": "^4.0.1", "get-video-id": "~3.1.0", "is-reachable": "~2.4.0", - "lodash": "~4.17.10", "p-locate": "~3.0.0" }, "devDependencies": {