Last active
April 20, 2025 15:36
Revisions
-
ashtonmeuser revised this gist
Apr 20, 2025 . 1 changed file with 10 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,18 @@ (() => { const matchingDivs = Array.from(document.querySelectorAll('div')).filter(div => Array.from(div.classList).some(cls => ['DivDescriptionContentContainer', 'DivDesContainer', 'DivVideoDescription'].some(sub => cls.includes(sub)) ) ); const lines = matchingDivs.map(div => `"${div.innerText.trim().replace(/"/g, '""')}"` ); const proceed = confirm(`Found ${lines.length} captions. Do you want to download them as CSV?`); if (!proceed) return; const content = `text,label\n${lines.join('\n')}`; const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' }); const link = document.createElement('a'); -
ashtonmeuser created this gist
Apr 20, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ (() => { const matchingDivs = Array.from(document.querySelectorAll('div')).filter(div => Array.from(div.classList).some(cls => cls.includes('DivDesContainer') || cls.includes('DivVideoDescription')) ); const lines = matchingDivs.map(div => `"${div.innerText.trim().replace(/"/g, '""')}"`); const content = lines.join('\n'); const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' }); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.download = 'data.csv'; document.body.appendChild(link); // Required for Firefox link.click(); document.body.removeChild(link); })();