alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
6.76k stars 421 forks source link

[Feature request] Add multiple links #206

Open piter-pit opened 1 year ago

piter-pit commented 1 year ago

Would it be possible to add feature that would allow to add multiple links at once (multiple line input) I believe currently it is possible to add only one link either movie or playlist/channel.

PikuZheng commented 1 year ago

It is possible to push multiple links sequentially to metube using other programs, but why? What is the source of multiple links?

piter-pit commented 1 year ago

I've tried plugin for browser but failed. The source would be just part of the playlist (update) or when playlist is not supported for specific service

PikuZheng commented 1 year ago

Try using bash and a loop to bulk add from text like this https://github.com/alexta69/metube/issues/96#issuecomment-1003643265

or metube plugin for chrome, can't batch but can reduce workload.

piter-pit commented 1 year ago

Thanks, I haven't noticed that topic - I checked - I swear :) ok, maybe first page only :) Nevertheless import via bash especially for docker goes against GUI idea, although it is some kind of solution.

kblock1 commented 1 year ago

I've tried plugin for browser but failed. The source would be just part of the playlist (update) or when playlist is not supported for specific service

What failed with the browser plugin? You'll need to be able to access metube on https if you are trying to use the add-in for youtube videos

piter-pit commented 1 year ago

I mean, I use Firefox plugin and it allows add only one link

PikuZheng commented 1 year ago

I mean, I use Firefox plugin and it allows add only one link

a simple html page for batch add download links (one link per line) if you want to try:

<!DOCTYPE HTML>
<html><body>
<script language="javascript" type="text/javascript">
    function add_to_metube(){
        var links=document.getElementById("links").value.split("\n")
        links.forEach(function(link){
            if(link!=''){
                        var xhr = new XMLHttpRequest()
                        xhr.open('POST', 'http://your-metube-web-address:8090/add', true)
                        var str = '{"url":"'+link+'","quality":"best"}'
                        xhr.send(str)          
            }; //end if
        }); //end forEach
        alert("added!");
    }; //end function
</script>

<textarea id="links" style="width:400px;height:300px"></textarea>
<br />
<input type="button" id="add-to-metube" value="add-to-metube!" onclick="add_to_metube()" />
</body></html>

image

piter-pit commented 1 year ago

Yes, thank you :) It works fine. Is it foreseen to implement it to MeTube?

PikuZheng commented 1 year ago

Yes, thank you :) It works fine. Is it foreseen to implement it to MeTube?

Currently it is very crude, and there is still a lot of work to be done before it can be officially used. maybe in the future?

wweevv-johndpope commented 1 year ago

this maybe useful - hat tip to @lanfon72 - though it still needs to be wired up https://gist.github.com/lanfon72/7284f83552eb871220804f8ee850fe0e