ionic-youtube-search
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -70,13 +70,21 @@ "use strict"; | ||
}); | ||
html = JSON.parse(html); | ||
} | ||
catch (e) { /* nothing */ } | ||
html = "`" + JSON.stringify(html) + "`"; | ||
navigator.clipboard.writeText(html); | ||
try { | ||
details = JSON.parse(html.split('{"itemSectionRenderer":{"contents":')[html.split('{"itemSectionRenderer":{"contents":').length - 1].split(',"continuations":[{')[0]); | ||
if (html && html.contents && html.contents.sectionListRenderer && html.contents.sectionListRenderer.contents | ||
&& html.contents.sectionListRenderer.contents.length > 0 && html.contents.sectionListRenderer.contents[0].itemSectionRenderer && | ||
html.contents.sectionListRenderer.contents[0].itemSectionRenderer.contents.length > 0) { | ||
details = html.contents.sectionListRenderer.contents[0].itemSectionRenderer.contents; | ||
fetched = true; | ||
} | ||
catch (e) { /* nothing */ } | ||
if (!fetched) { | ||
try { | ||
details = JSON.parse(html.split('{"itemSectionRenderer":{"contents":')[html.split('{"itemSectionRenderer":{"contents":').length - 1].split(',"continuations":[{')[0]); | ||
fetched = true; | ||
} | ||
catch (e) { /* nothing */ | ||
} | ||
} | ||
if (!fetched) { | ||
try { | ||
details = JSON.parse(html.split('{"itemSectionRenderer":')[html.split('{"itemSectionRenderer":').length - 1].split('},{"continuationItemRenderer":{')[0]).contents; | ||
@@ -83,0 +91,0 @@ fetched = true; |
{ | ||
"name": "ionic-youtube-search", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Search videos on YouTube without API key in ionic apps", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28628
282