(target, sectionNode)
| 817 | } |
| 818 | |
| 819 | async function storyGetUrl(target, sectionNode) { |
| 820 | let url = null; |
| 821 | if (!disableNewUrlFetchMethod) url = await getUrlFromInfoApi(target); |
| 822 | |
| 823 | if (!url) { |
| 824 | if (sectionNode.querySelector("video > source")) { |
| 825 | url = sectionNode |
| 826 | .querySelector("video > source") |
| 827 | .getAttribute("src"); |
| 828 | } else if (sectionNode.querySelector('img[decoding="sync"]')) { |
| 829 | let img = sectionNode.querySelector('img[decoding="sync"]'); |
| 830 | url = img.srcset.split(/ \d+w/g)[0].trim(); // extract first src from srcset attr. of img |
| 831 | if (url.length > 0) { |
| 832 | return url; |
| 833 | } |
| 834 | url = sectionNode |
| 835 | .querySelector('img[decoding="sync"]') |
| 836 | .getAttribute("src"); |
| 837 | } else if (sectionNode.querySelector("video")) { |
| 838 | url = sectionNode.querySelector("video").getAttribute("src"); |
| 839 | } |
| 840 | } |
| 841 | return url; |
| 842 | } |
| 843 | |
| 844 | function filenameFormat( |
| 845 | template, |
no test coverage detected