From 77e812333b607a688d1398fdd34d507780d7e1e4 Mon Sep 17 00:00:00 2001 From: qsniyg Date: Sat, 27 Jan 2024 11:59:08 +0000 Subject: [PATCH] Return all bitrate urls for tiktok web api --- src/userscript.ts | 65 +++++++++++---- userscript.user.js | 203 ++++++++++++++++++++++++++------------------- 2 files changed, 168 insertions(+), 100 deletions(-) diff --git a/src/userscript.ts b/src/userscript.ts index 866e80b9..708a1da7 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -46885,11 +46885,9 @@ var $$IMU_EXPORT$$; try { var item = data.itemInfo.itemStruct; - var videourl = item.video.bitrateInfo[0].PlayAddr.UrlList[0] || item.video.downloadAddr || item.video.playAddr; var caption = item.desc; - var obj:BigImageInfoSObject = { - url: videourl, + let baseobj:BigImageInfoSObject = { extra: { caption: caption }, @@ -46901,20 +46899,47 @@ var $$IMU_EXPORT$$; "sec-fetch-site": "same-site" }, cookie_url: "https://www.tiktok.com/", - video: true, can_head: false, //can_multiple_request: false }; if (data.metaParams && data.metaParams.canonicalHref) { - obj.extra.page = data.metaParams.canonicalHref; + baseobj.extra.page = data.metaParams.canonicalHref; } else { - obj.extra.page = "https://www.tiktok.com/@" + item.author.uniqueId + "/video/" + item.id; + baseobj.extra.page = "https://www.tiktok.com/@" + item.author.uniqueId + "/video/" + item.id; } - common_functions["set_tiktok_vid_filename"](obj); + //var videourl = item.video.bitrateInfo[0].PlayAddr.UrlList[0] || item.video.downloadAddr || item.video.playAddr; - return obj; + let urls:BigImageInfoMObject = []; + for (let bri of item.video.bitrateInfo) { + let codec = null; + if (bri.CodecType === "h265_hvc1") { + codec = "hevc"; + } else if (bri.CodecType !== "h264") { + console_warn("Unknown codec type for", bri); + } + + if (!bri.PlayAddr.UrlList.length || !bri.PlayAddr.UrlList[0]) { + console_warn("Skipping", bri); + continue; + } + + urls.push({ + url: bri.PlayAddr.UrlList[0], + media_info: { + type: "video", + codec + } + }); + } + + let finalobj = fillobj_urls(urls, baseobj); + for (let obj of finalobj) { + common_functions["set_tiktok_vid_filename"](obj); + } + + return finalobj; } catch (e) { console_error(e); return null; @@ -47051,17 +47076,25 @@ var $$IMU_EXPORT$$; var remove_tiktok_watermark = function(obj, cb) { var page = null; - if (obj.extra && obj.extra.page) page = obj.extra.page; - common_functions["tiktok_remove_watermark"](api_cache, options, obj.url, page, function(newurl) { + let sobj = obj; + if (is_array(obj)) + sobj = obj[0]; + + if (sobj.extra && sobj.extra.page) page = sobj.extra.page; + + common_functions["tiktok_remove_watermark"](api_cache, options, sobj.url, page, function(newurl) { if (newurl) { - obj = fillobj_urls([newurl], obj)[0]; + sobj = fillobj_urls([newurl], sobj)[0]; } - if (!common_functions["set_tiktok_vid_filename"](obj)) { - delete obj.filename; + if (!common_functions["set_tiktok_vid_filename"](sobj)) { + delete sobj.filename; } + if (is_array(obj)) + obj[0] = sobj; + return cb(obj); }); }; @@ -47101,7 +47134,11 @@ var $$IMU_EXPORT$$; } } else { remove_tiktok_watermark(obj, function(obj) { - return options.cb([obj, page_nullobj]); + if (!is_array(obj)) + obj = [obj]; + + obj.push(page_nullobj); + return options.cb(obj); }); } }; diff --git a/userscript.user.js b/userscript.user.js index f855bc3b..c86d09d3 100644 --- a/userscript.user.js +++ b/userscript.user.js @@ -42790,10 +42790,8 @@ var $$IMU_EXPORT$$; } try { var item = data.itemInfo.itemStruct; - var videourl = item.video.bitrateInfo[0].PlayAddr.UrlList[0] || item.video.downloadAddr || item.video.playAddr; var caption = item.desc; - var obj = { - url: videourl, + var baseobj_2 = { extra: { caption: caption }, @@ -42805,17 +42803,42 @@ var $$IMU_EXPORT$$; "sec-fetch-site": "same-site" }, cookie_url: "https://www.tiktok.com/", - video: true, can_head: false, //can_multiple_request: false }; if (data.metaParams && data.metaParams.canonicalHref) { - obj.extra.page = data.metaParams.canonicalHref; + baseobj_2.extra.page = data.metaParams.canonicalHref; } else { - obj.extra.page = "https://www.tiktok.com/@" + item.author.uniqueId + "/video/" + item.id; + baseobj_2.extra.page = "https://www.tiktok.com/@" + item.author.uniqueId + "/video/" + item.id; } - common_functions["set_tiktok_vid_filename"](obj); - return obj; + //var videourl = item.video.bitrateInfo[0].PlayAddr.UrlList[0] || item.video.downloadAddr || item.video.playAddr; + var urls_3 = []; + for (var _i = 0, _a = item.video.bitrateInfo; _i < _a.length; _i++) { + var bri = _a[_i]; + var codec = null; + if (bri.CodecType === "h265_hvc1") { + codec = "hevc"; + } else if (bri.CodecType !== "h264") { + console_warn("Unknown codec type for", bri); + } + if (!bri.PlayAddr.UrlList.length || !bri.PlayAddr.UrlList[0]) { + console_warn("Skipping", bri); + continue; + } + urls_3.push({ + url: bri.PlayAddr.UrlList[0], + media_info: { + type: "video", + codec: codec + } + }); + } + var finalobj = fillobj_urls(urls_3, baseobj_2); + for (var _b = 0, finalobj_1 = finalobj; _b < finalobj_1.length; _b++) { + var obj_1 = finalobj_1[_b]; + common_functions["set_tiktok_vid_filename"](obj_1); + } + return finalobj; } catch (e) { console_error(e); return null; @@ -42936,15 +42959,20 @@ var $$IMU_EXPORT$$; }; var remove_tiktok_watermark = function(obj, cb) { var page = null; - if (obj.extra && obj.extra.page) - page = obj.extra.page; - common_functions["tiktok_remove_watermark"](api_cache, options, obj.url, page, function(newurl) { + var sobj = obj; + if (is_array(obj)) + sobj = obj[0]; + if (sobj.extra && sobj.extra.page) + page = sobj.extra.page; + common_functions["tiktok_remove_watermark"](api_cache, options, sobj.url, page, function(newurl) { if (newurl) { - obj = fillobj_urls([newurl], obj)[0]; + sobj = fillobj_urls([newurl], sobj)[0]; } - if (!common_functions["set_tiktok_vid_filename"](obj)) { - delete obj.filename; + if (!common_functions["set_tiktok_vid_filename"](sobj)) { + delete sobj.filename; } + if (is_array(obj)) + obj[0] = sobj; return cb(obj); }); }; @@ -42981,7 +43009,10 @@ var $$IMU_EXPORT$$; } } else { remove_tiktok_watermark(obj, function(obj) { - return options.cb([obj, page_nullobj]); + if (!is_array(obj)) + obj = [obj]; + obj.push(page_nullobj); + return options.cb(obj); }); } }; @@ -43027,25 +43058,25 @@ var $$IMU_EXPORT$$; } } if ((domain_nosub === "muscdn.com" || domain_nosub === "tiktokcdn.com") && /^v[0-9]+m?\./.test(domain)) { - var baseobj_2 = { + var baseobj_3 = { url: src, video: true, can_head: false // 503 sometimes }; - common_functions["set_tiktok_vid_filename"](baseobj_2); + common_functions["set_tiktok_vid_filename"](baseobj_3); if (options.do_request && options.cb && options.rule_specific && options.rule_specific.tiktok_no_watermarks) { common_functions["get_best_tiktok_url"](api_cache, options.do_request, src, function(newurl) { if (newurl) { - baseobj_2.url = newurl; + baseobj_3.url = newurl; } - common_functions["set_tiktok_vid_filename"](baseobj_2); - options.cb(baseobj_2); + common_functions["set_tiktok_vid_filename"](baseobj_3); + options.cb(baseobj_3); }); return { waiting: true }; } else { - return baseobj_2; + return baseobj_3; } } if ((domain_nosub === "pstatp.com" || @@ -49756,13 +49787,13 @@ var $$IMU_EXPORT$$; // https://media2.giphy.com/media/ZBg5XWrvDVzNe/200_s.gif // private gif: // https://i.giphy.com/media/gHPsfv5TM792hQdBRH/giphy.webp - var baseobj_3 = { + var baseobj_4 = { url: src, headers: { Referer: "https://giphy.com/" } }; - obj = baseobj_3; + obj = baseobj_4; match = src.match(/\/media\/+([^/]{10,})\/+/); if (match) { var get_giphy_page = function(id) { @@ -49770,7 +49801,7 @@ var $$IMU_EXPORT$$; }; id = match[1]; var page = get_giphy_page(id); - baseobj_3.extra = { page: page }; + baseobj_4.extra = { page: page }; var query_giphy = function(id, cb) { var cache_key = "giphy:" + id; api_cache.fetch(cache_key, cb, function(done) { @@ -49810,7 +49841,7 @@ var $$IMU_EXPORT$$; } var images = data.images; var get_image = function(obj) { - var ourobj = deepcopy(baseobj_3); + var ourobj = deepcopy(baseobj_4); ourobj.url = obj.url; return ourobj; }; @@ -61081,7 +61112,7 @@ var $$IMU_EXPORT$$; // thanks to vscum on github: https://github.com/qsniyg/maxurl/pull/1147/files // https://cdn.eroticbeauties.net/content/metart_20160107202957_blake-bartelli-mointa-by-charles-lightfoot/auto/3/tn@2x/01.webp // https://cdn.eroticbeauties.net/content/metart_20160107202957_blake-bartelli-mointa-by-charles-lightfoot/full/01.jpg - var baseobj_4 = { + var baseobj_5 = { headers: { Referer: "http://" + domain_nosub + "/" }, @@ -61091,13 +61122,13 @@ var $$IMU_EXPORT$$; }; newsrc = src.replace(/\.webp([?#].*)?$/, ".jpg$1"); if (newsrc !== src) { - baseobj_4.url = newsrc; - return baseobj_4; + baseobj_5.url = newsrc; + return baseobj_5; } newsrc = src.replace(/(\/content\/+[^/]*\/+)(?:[^/]*\/+[^/]*\/+)?(?:tn@[^/]*|[0-9]+|main)\/+((?:[^/.]+_)?[0-9]+\.[^/.]*)$/, "$1full/$2"); if (newsrc !== src) { - baseobj_4.url = newsrc; - return baseobj_4; + baseobj_5.url = newsrc; + return baseobj_5; } } if (domain_nowww === "barahla.net") { @@ -62065,11 +62096,11 @@ var $$IMU_EXPORT$$; }, src ]; - var baseobj_5 = {}; + var baseobj_6 = {}; var match = src.match(/\/([0-9]+)-[^/]+\.[^/.]+(?:[?#].*)?$/); if (match) { id = match[1]; - baseobj_5.extra = { + baseobj_6.extra = { page: "https://www.123rf.com/photo_" + id + ".html" }; if (options.do_request && options.cb) { @@ -62077,25 +62108,25 @@ var $$IMU_EXPORT$$; url: "https://www.123rf.com/photo_" + id + ".html", }, function(data) { if (data) { - baseobj_5 = data; + baseobj_6 = data; } - return options.cb(fillobj_urls(urls, baseobj_5)); + return options.cb(fillobj_urls(urls, baseobj_6)); }, function(done, resp, cache_key) { var match = resp.responseText.match(/dataLayer\.push\({[\s\S]+?["']product_name["']:\s*["'](.*?)["'],/); - baseobj_5.extra.page = resp.finalUrl; + baseobj_6.extra.page = resp.finalUrl; if (match) { - baseobj_5.extra.caption = match[1]; + baseobj_6.extra.caption = match[1]; } else { console_warn(cache_key, "Unable to find match in", resp); } - done(baseobj_5, 24 * 60 * 60); + done(baseobj_6, 24 * 60 * 60); }); return { waiting: true }; } } - return fillobj_urls(urls, baseobj_5); + return fillobj_urls(urls, baseobj_6); } } if (domain_nowww === "chenderroad.com") { @@ -66463,7 +66494,7 @@ var $$IMU_EXPORT$$; domain.match(/^[sb][0-9]*\./)) { // http://s10.trafficdeposit.com/blog/vid/57d2f694dd228/5a4114fc9056e/small.jpg // http://s10.trafficdeposit.com/blog/vid/57d2f694dd228/5a4114fc9056e/full.jpg - var baseobj_6 = { + var baseobj_7 = { url: src, extra: {} }; @@ -66473,9 +66504,9 @@ var $$IMU_EXPORT$$; match = src.match(/^[a-z]+:\/\/[^/]+\/+blog\/+(?:[0-9]+\/+[0-9]+\/+)?(?:vid|img)\/+(?:[0-9a-f]+|porn-collection)\/+([0-9a-f]{10,})\/+[^/]+$/); if (match) { id = match[1]; - baseobj_6.extra.page = "https://sxyprn.com/post/" + id + ".html"; + baseobj_7.extra.page = "https://sxyprn.com/post/" + id + ".html"; urls.push({ - url: baseobj_6.extra.page, + url: baseobj_7.extra.page, is_pagelink: true }); } @@ -66484,7 +66515,7 @@ var $$IMU_EXPORT$$; urls.push(newsrc); } urls.push(src); - return fillobj_urls(urls, baseobj_6); + return fillobj_urls(urls, baseobj_7); } if (domain_nosub === "sxyprn.com") { match = src.match(/^[a-z]+:\/\/[^/]+\/+post\/+([0-9a-f]{10,})\.html/); @@ -75946,13 +75977,13 @@ var $$IMU_EXPORT$$; return add_full_extensions(newsrc); match = src.match(/^[a-z]+:\/\/[^/]*\/+([^/]*)\/+(?:thumb|data\/+)([0-9]+)-/); if (match) { - var obj_1 = { + var obj_2 = { url: src, extra: { page: "https://aryion.com/" + match[1] + "/view/" + match[2] } }; - return obj_1; + return obj_2; } } if (domain === "ano.lolcathost.org") { @@ -81303,10 +81334,10 @@ var $$IMU_EXPORT$$; regex = /(\/live\/+cover_images\/+.*_)([0-9]+x[0-9]+)(\.[^/.]+)(?:[?#].*)?$/; match = src.match(regex); if (match) { - var baseobj_7 = { url: src }; + var baseobj_8 = { url: src }; var idmatch = src.match(/\/live\/+cover_images\/+[^/]+\/+([^/_]{5,15})_/); if (idmatch) { - baseobj_7.extra = { page: "https://www.bitchute.com/video/" + idmatch[1] + "/" }; + baseobj_8.extra = { page: "https://www.bitchute.com/video/" + idmatch[1] + "/" }; } var sizes = [ "1280x720", @@ -81321,14 +81352,14 @@ var $$IMU_EXPORT$$; var newurls = []; array_foreach(sizes, function(size) { if (urlsize < sizetoint(size)) { - var obj = deepcopy(baseobj_7); + var obj = deepcopy(baseobj_8); obj.url = src.replace(regex, "$1" + size + "$3"); newurls.push(obj); } }); - if (idmatch && baseobj_7.extra && baseobj_7.extra.page) { + if (idmatch && baseobj_8.extra && baseobj_8.extra.page) { newurls.unshift({ - url: baseobj_7.extra.page, + url: baseobj_8.extra.page, is_pagelink: true }); } @@ -81337,8 +81368,8 @@ var $$IMU_EXPORT$$; } var videourl = src.replace(/^[a-z]+:\/\/static-([0-9])\.bitchute\.com\/+live\/+cover_images\/+([^/]+\/+[^/_]{5,15})_[0-9]+x[0-9]+\..*/, "https://seed$100.bitchute.com/$2.mp4"); if (videourl !== src) { - baseobj_7.url = videourl; - return baseobj_7; + baseobj_8.url = videourl; + return baseobj_8; } } } @@ -82425,13 +82456,13 @@ var $$IMU_EXPORT$$; regex = /(\/v\/+[0-9a-f]{10,}\/+)([0-9]+)(\.[^/.]+)(?:[?#].*)?$/; match = src.match(regex); if (match) { - var obj_2 = []; + var obj_3 = []; for (var i_8 = 0; i_8 < sizes_1.length; i_8++) { if (sizes_1[i_8] <= match[1]) break; - obj_2.push(src.replace(regex, "$1" + sizes_1[i_8] + "$3")); + obj_3.push(src.replace(regex, "$1" + sizes_1[i_8] + "$3")); } - return obj_2; + return obj_3; } } if (domain_nowww === "censored.tv") { @@ -86661,14 +86692,14 @@ var $$IMU_EXPORT$$; } } if (id) { - var baseobj_8 = { + var baseobj_9 = { url: src, extra: { page: "https://www.streamable.com/" + id } }; if (page_nullobj) - page_nullobj.extra = baseobj_8.extra; + page_nullobj.extra = baseobj_9.extra; var query_streamable = function(id, cb) { api_query("streamable:" + id, { url: "https://www.streamable.com/" + id @@ -86681,7 +86712,7 @@ var $$IMU_EXPORT$$; var json = JSON_parse(match[1]); var title = json.title || json.reddit_title; if (title) { - baseobj_8.extra.caption = title; + baseobj_9.extra.caption = title; } var urls = []; if (json.files) { @@ -86730,20 +86761,20 @@ var $$IMU_EXPORT$$; if (options.cb && options.do_request) { query_streamable(id, function(obj) { if (!obj) { - return options.cb(page_nullobj || baseobj_8); + return options.cb(page_nullobj || baseobj_9); } if (!is_array(obj)) { obj = [obj]; } if (page_nullobj) obj.push(page_nullobj); - return options.cb(fillobj_urls(obj, baseobj_8)); + return options.cb(fillobj_urls(obj, baseobj_9)); }); return { waiting: true }; } else { - return page_nullobj || baseobj_8; + return page_nullobj || baseobj_9; } } } @@ -88489,12 +88520,12 @@ var $$IMU_EXPORT$$; var urls = []; array_extend(urls, objs.watermark); array_extend(urls, objs.smaller); - var baseobj_9 = { + var baseobj_10 = { extra: { page: "https://www.imago-images.de/st/" + match[1] } }; - return fillobj_urls(urls, baseobj_9); + return fillobj_urls(urls, baseobj_10); } } if (domain_nowww === "banned.video" || @@ -89290,13 +89321,13 @@ var $$IMU_EXPORT$$; // https://img.monaffy.jp/img/picture_place/original/41872.png // https://img.monaffy.jp/img/profile/small/19178.png?1600876068 // https://img.monaffy.jp/img/profile/original/19178.png?1600876068 - var obj_3 = { + var obj_4 = { url: src.replace(/(\/img\/+(?:picture_place|profile)\/+)[a-z]+\/+([0-9]+\.)/, "$1original/$2") }; match = src.match(/\/img\/+picture_place\/+[a-z]+\/+([0-9]+)\./); if (match) - obj_3.extra = { page: "https://monappy.jp/picture_places/view/" + match[1] }; - return obj_3; + obj_4.extra = { page: "https://monappy.jp/picture_places/view/" + match[1] }; + return obj_4; } if (domain === "i.iheart.com") { // https://i.iheart.com/v3/re/new_assets/5a91863a79b810a683361620?ops=fit(770%2C385) @@ -92059,14 +92090,14 @@ var $$IMU_EXPORT$$; // https://ih1.redbubble.net/image.332651033.3838/bg,transparent.png -- 937x900 var basename = url_basename(src); var newbn; - var obj_4 = { + var obj_5 = { url: src, can_head: false, head_wrong_contentlength: true }; var get_rb_obj = function() { - obj_4.url = urljoin(src, newbn, true); - return obj_4; + obj_5.url = urljoin(src, newbn, true); + return obj_5; }; // thanks to anonymous for reporting: // https://ih1.redbubble.net/image.2940258874.1093/tsss,small,product,750x1000.webp @@ -92104,7 +92135,7 @@ var $$IMU_EXPORT$$; newbn = basename.replace(/^(work\.[0-9]+\.[0-9]+\.).*?(\.[^/.]+)(?:[?#].*)?$/, "$1bg,transparent$2"); return get_rb_obj(); } - return obj_4; + return obj_5; } if (domain === "res.booklive.jp") { // thanks to fireattack on github: https://github.com/qsniyg/maxurl/issues/587 @@ -92527,7 +92558,7 @@ var $$IMU_EXPORT$$; } if (domain === "cdn.media.amplience.net") { // https://cdn.media.amplience.net/i/harryrosen/20096712053_large.webp - var obj_5 = { + var obj_6 = { url: src, bad_if: [{ headers: { @@ -92546,10 +92577,10 @@ var $$IMU_EXPORT$$; // https://cdn.media.amplience.net/i/harryrosen/20096712053 -- 3370x4000 // other: // https://cdn.media.amplience.net/i/frasersdev/62443469_o.jpg?v=230331172020 -- 2000x2000 - obj_5.url = src + obj_6.url = src .replace(/(\/i\/+harryrosen\/+[0-9]+)_[a-z]+(?:\.[a-z]+)?(?:[?#].*)?$/, "$1") .replace(/(\/s\/+hottopic\/+[0-9]+_hi)(?:_[a-z]+)?(?:\.[a-z]+)?(?:[?#].*)?$/, "$1"); - return obj_5; + return obj_6; } if (domain_nowww === "indigowhitetv.com") { // https://indigowhitetv.com/assets/heart-circle-pink.PNG @@ -96632,8 +96663,8 @@ var $$IMU_EXPORT$$; var obj = common_functions["get_videotag_obj"](resp); if (!obj) return done(null, false); - for (var _i = 0, obj_6 = obj; _i < obj_6.length; _i++) { - var sobj = obj_6[_i]; + for (var _i = 0, obj_7 = obj; _i < obj_7.length; _i++) { + var sobj = obj_7[_i]; if (sobj.video) { // referer = "" doesn't work sobj.headers.Referer = null; @@ -98264,9 +98295,9 @@ var $$IMU_EXPORT$$; }); var urls = []; for (var _i = 0, json_4 = json; _i < json_4.length; _i++) { - var obj_7 = json_4[_i]; + var obj_8 = json_4[_i]; urls.push({ - url: urljoin("https://" + domain + "/", vxxx_b64_1(obj_7.video_url), true), + url: urljoin("https://" + domain + "/", vxxx_b64_1(obj_8.video_url), true), video: true }); } @@ -99704,19 +99735,19 @@ var $$IMU_EXPORT$$; var picid = match[2]; var picid_4 = picid.match(/^([0-9]{4})/)[1]; var picid_2 = picid.match(/^[0-9]{4}([0-9]{2})/)[1]; - var urls_3 = []; + var urls_4 = []; if (board in archive_map) { var provider = archive_map[board]; if (provider === "thebarchive") { - urls_3.push("https://thebarchive.com/data/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg"); + urls_4.push("https://thebarchive.com/data/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg"); } else if (provider === "fireden") { - urls_3.push("https://img-lb.fireden.net/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg"); + urls_4.push("https://img-lb.fireden.net/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg"); } else if (provider === "archiveofsins") { - urls_3.push("https://archiveofsins.com/data/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg"); + urls_4.push("https://archiveofsins.com/data/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg"); } } - urls_3.push("https://i.4cdn.org/" + board + "/" + picid + "s.jpg"); - return urls_3; + urls_4.push("https://i.4cdn.org/" + board + "/" + picid + "s.jpg"); + return urls_4; } } if (domain_nowww === "masterfap.net") { @@ -99887,7 +99918,7 @@ var $$IMU_EXPORT$$; var chosenitem = null; for (var itemid in content.contents) { var item = content.contents[itemid]; - var obj_8 = { + var obj_9 = { url: item.link, headers: { Referer: "https://gofile.io/" @@ -99902,14 +99933,14 @@ var $$IMU_EXPORT$$; }; var mime = item.mimetype || ""; if (/^video\//.test(mime)) - obj_8.video = true; + obj_9.video = true; else if (!/^(?:image|audio)\//.test(mime)) { console_warn("Skipping", item, "due to mime:", mime); continue; } - items.push(obj_8); + items.push(obj_9); if (itemid === id) - chosenitem = obj_8; + chosenitem = obj_9; } if (chosenitem) { return cb(chosenitem);