mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
youtube to mp3
parent
ff29c94663
commit
be1a6334f1
1 changed files with 43 additions and 0 deletions
|
|
@ -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`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue