youtube to mp3

coderaiser 2023-01-15 13:51:51 +02:00
parent ff29c94663
commit be1a6334f1

@ -49,6 +49,49 @@ export default {
}
```
## Convert YouTube to `mp3`
```js
export default {
'Y - Youtube to mp3': async ({CloudCmd, DOM}) => {
const {View} = CloudCmd;
const {Dialog} = DOM;
const [, url] = await Dialog.prompt('YouTube URL:');
if (!url)
return;
const {default: createElement} = await import('https://cdn.skypack.dev/@cloudcmd/create-element')
const element = createElement('iframe', {
id: 'youtube-to-mp3',
width: '100%',
height: '100%',
src: `https://convert2mp3s.com/api/single/mp3?url=${url}`,
allowtransparency:"true" ,
scrolling: 'no',
style: 'border: none;',
notAppend: true,
});
createElement('style', {
parent: document.head,
dataName: 'youtube-to-mp3-style',
textContent: `
.view:has(#youtube-to-mp3) {
overflow: hidden
}
`
});
View.show(element, {
autoSize: true,
});
},
}
```
## Convert `*.flac` or `*.mp4` to `*.mp3` and put to `mp3` directory.
Simple example of running bash scripts with help of `TerminalRun`.