Giter Site home page Giter Site logo

hyeonsangjeon / youtube-dl-nas Goto Github PK

View Code? Open in Web Editor NEW
151.0 10.0 54.0 667 KB

youtube download queue websocket server with login for private NAS.

License: MIT License

Dockerfile 3.44% Python 30.01% Shell 2.09% CSS 14.01% JavaScript 24.37% Smarty 26.10%
youtube youtube-dl nas python queue websocket bottle docker login bootstrap

youtube-dl-nas's Introduction

GitHub license Docker Pulls Shield Docker Stars Shield

youtube-dl-nas

simple youtube download micro web queue server. To prevent a queue attack when using NAS as a server, a making account was created when creating a docker container, and a new UI was added. This Queue server based on python3 and debian Linux. https://hub.docker.com/r/modenaf360/youtube-dl-nas/

screenshot1

Update Info

  • 2023.02.19 : [Patch] Changed the executable from youtube-dl to yt-dlp for fixed error about 'Unable to extract uploader id' and download speed..
  • 2022.09.29 : [Patch] Check for updates essential packages on first startup container.
  • 2022.09.28 : [Patch] Clears URL input when submitting the form.
  • 2021.12.09 : [Patch] Fix proxy setting bug
  • 2021.05.03 : [Patch] Fix random mkv or mp4 format when specifying resolution
  • 2020.11.13 : [Patch] Added docker optinal variable to support youtube-dl proxy
  • 2020.08.12 : [Patch] Added audio-mp3 option
  • 2019.04.25 : [Patch] Failed to fetch jessie backports repository patch during build Dockerfile, Add Scheduler update "pip install -U youtube-dl" once a day.You no longer need to update pip youtube-dl when inexecutable in the container.
  • 2020.04.07 : [Patch] Audio only option for web-ui and REST call. Change username field type for compatiblity
  • 2020.02.10 : [Patch] Modifying so this will work behind HTTPS as well.
  • 2019.02.13 : [Patch] binary excution error update, : 'caused by ExtractorError("Could not find JS function 'encodeURIComponent'; please report this issue on https://yt-dl.org/bug ..'. Binary Excution file update docker rebuild,Specify release version in html page
  • 2018.11.08 : [Patch] binary excution error update, : 'youtube_dl.utils.RegexNotFoundError: Unable to extract Initial JS player signature function name'. some url like(https://youtu.be/), Handling Variables on Application Ports for Using the docker Network Host Mode,Specify release version in html page
  • 2018.10.06 : [Patch] Prevent thread death due to websocket exception in walker thread after download, add REST API
  • 2018.10.01 : [Minor Patch] Patching worker thread dead symptom when moving the browser during download, add resolution 1440p, 2160p(4k)
  • 2018.09.28 : [Add functional option] Resolution selectable, Downloaded result html table representation**

You can check the status of download queue processing in real time using websocket from the message below the text box.

screenshot

How to use this image

To run docker, excute this command in a ternimal:

The docker volume parameter -v is used by the queue operation to process the downloaded mount path to the host server

  • downloaded docker volume path : '/downfolder'
  • MY_ID, MY_PW : Required variables when you login validation, The start character '!' '$' '&' is does not apply.
  • TZ : optional variable.

docker options are as follows,

Variables Description
-v host:guest /downfolder (do not change guest location. expose volume mount to host server)
-d background run
-p host:guest expose port conainer core-os port to your os (port fowarding)
-e MY_ID using it login id, linux environment variables, do not use start character '!' '$' '&'
-e MY_PW using it login password, linux environment variables , do not use start character '!' '$' '&'
-e TZ take it to user country, linux environment variables
-e APP_PORT optinal variable. default is 8080
-e PROXY optinal variable. set youtube-dl proxy, default is ""
To run docker, excute this command in a ternimal:
docker run -d --name youtube-dl -e MY_ID=modenaf360 -e MY_PW=1234  -v /volume2/youtube-dl:/downfolder -p 8080:8080 modenaf360/youtube-dl-nas
If want set TimeZone, example using in South-Korea web content
docker run -d --name youtube-dl -e TZ=Asia/Seoul -e MY_ID=modenaf360 -e MY_PW=1234 -v /volume2/youtube-dl:/downfolder -p 8080:8080 modenaf360/youtube-dl-nas
example, how to using docker host network and changing the application port :
# use --net=host -e APP_PORT=custom_port
docker run -d --name youtube-dl --net=host -e APP_PORT=9999 -e MY_ID=modenaf360 -e MY_PW=1234  -v /volume2/youtube-dl:/downfolder modenaf360/youtube-dl-nas

Request restful API & Response

curl -X POST http://localhost:8080/youtube-dl/rest \
  -d '{
	"url":"https://www.youtube.com/watch?v=s9mO5q6GiAc",
	"resolution":"best", 
	"id":"iamgroot",
	"pw":"1234"
}'
{
    "success": true,
    "msg": "download has started",
    "Remaining downloading count": "7"
}

If you want to get into docker container os, excute this command [1] :

docker exec -i -t youtube-dl /bin/bash
Example, when using synology docker provisioning platform
  • docker volume mount setting

screenshot1

  • ID, Password setting to docker environment screenshot1

Reference

[1]. https://docs.docker.com/engine/reference/commandline/cli/#environment-variables

youtube-dl-nas's People

Contributors

devnat0 avatar hervey424 avatar hyeonsangjeon avatar joshstrange avatar palla89 avatar sofn avatar thotmail avatar tlvu avatar vfauth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtube-dl-nas's Issues

How to disable User/PW Login?

Hi there, awesome that you share your code. Thank you very much!

Can you say how to disable user/pw screen when running fully locally the instance?

Thanks and kind regards

PhantomJS support

Hello there I try to download the videos on openload.co,but the youtube-dl tell the error message

"ERROR: PhantomJS executable not found in PATH, download it from http://phantomjs.org"

It would be great if the PhantomJS support can be added, thanks a lot!

Proxy Support

web got error: url access failure
youtube_dl proxy set: youtube-dl --proxy socks5://$host:$port

failed to download playlist from youtube

youtube playlist link
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
exec subprocess 1day CompletedProcess(args=['pip', 'install', '-U', 'youtube-dl'], returncode=0)

Run without login?

Is there any way to run this without needing a username and password? It works great, but I don't need the security of a login.

How to delete the remnants of a file that failed... i.e. no access to .incomplete (permissions)

As per the above really, am unable to delete left over file fragments of failed downloads.
Can someone explain to me how or what permissions I need to use?

I tried via portainer in console and couldn't get to the folder I needed, was unable to locate it...
I tried in SFTP to access the actual download share, but had no permissions to amend the .incomplete directory's contents.

thx

url access failure

My download failed.

[youtube] BBVLj_PSsZ8: Downloading webpage
03:18:46 | [youtube] BBVLj_PSsZ8: Downloading video info webpage
03:18:46 | [youtube] BBVLj_PSsZ8: Downloading js player vflBMETJb
03:18:47 | �[0;31mERROR:�[0m Signature extraction failed: Traceback (most recent call last):
03:18:47 | File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1236, in _decrypt_signature
03:18:47 | video_id, player_url, s
03:18:47 | File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1144, in _extract_signature_function
03:18:47 | res = self._parse_sig_js(code)
03:18:47 | File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1208, in _parse_sig_js
03:18:47 | jscode, 'Initial JS player signature function name', group='sig')
03:18:47 | File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1004, in _search_regex
03:18:47 | raise RegexNotFoundError('Unable to extract %s' % _name)
03:18:47 | youtube_dl.utils.RegexNotFoundError: Unable to extract �[0;34mInitial JS player signature function name�[0m; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
03:18:47 | (caused by RegexNotFoundError('Unable to extract \x1b[0;34mInitial JS player signature function name\x1b[0m; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

DSM 7

Hello. Which login and pass I must to use?

image

URL input form not cleared after submit is pressed

Not sure if the project is still actively maintained but if anybody knows how to change the code to clear the URL input line after the form is submitted then I would gladly make the code modifications.

Now it is a bit confusing that after form submission, the last URL content is still in the input line. More tech savvy people can deal with it but less tech savvy get confused and press submit multiple times, leading to unnecessary queue build up.

Synology Docker: how to change the port?

Hi

8080 is already in use by another docker image

i tried adding a enviroment variable like this

host:guest with value of 8181:8181

but it doesnt change the port, any suggestions? thanks

Raspberry Pi with Docker: exec user process caused: exec format error

Sry, i can´t start your Container :(

my Compose / Stack

version: "3"

services:
  youtube-dl:
    image: modenaf360/youtube-dl-nas:latest
    container_name: youtube-dl
    hostname: youtube-dl
    
    ports:
      - 9060:8080

      
    volumes:
      - /media:/downfolder
      
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
      
    restart: always

Log Error:
standard_init_linux.go:228: exec user process caused: exec format error

No filename

The downloaded file has always the following filename: _.mp4.
Is there a way to change this?

안녕하세요. 혹시 이 애러는 왜 생기는건지 알수 있을까요?

유튜브 영상을 받으려고하면 아래와 같은 오류가 발생하는데 어떻게 해야하나요?

2019-01-30 19:17:22,stdout," (caused by ExtractorError("Could not find JS function 'encodeURIComponent'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
"
2019-01-30 19:17:22,stdout,youtube_dl.utils.ExtractorError: Could not find JS function 'encodeURIComponent'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

2019-01-30 19:17:22,stdout, raise ExtractorError('Could not find JS function %r' % funcname)

2019-01-30 19:17:22,stdout," File "/usr/local/lib/python3.6/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
"
2019-01-30 19:17:22,stdout, initial_function = jsi.extract_function(funcname)

2019-01-30 19:17:22,stdout," File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1200, in _parse_sig_js
"
2019-01-30 19:17:22,stdout, res = self._parse_sig_js(code)

2019-01-30 19:17:22,stdout," File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1133, in _extract_signature_function
"
2019-01-30 19:17:22,stdout," video_id, player_url, s
"
2019-01-30 19:17:22,stdout," File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1225, in _decrypt_signature
"
2019-01-30 19:17:22,stdout,�[0;31mERROR:�[0m Signature extraction failed: Traceback (most recent call last):

Downloading Failed - url access failure

When trying to download a video I run into this error. It doesn't happen for all videos, just some.

[ffmpeg] Merging formats into "./downfolder/.incomplete/video.mp4"
ERROR: av_interleaved_write_frame(): Invalid argument

Is it possible to run on a schedule?

I want to use this to archive one of my channels to an offsite Synology NAS. Is it possible to set it on a schedule to automatically download the latest uploads?

Skipping videos with error

Hi,

I'm just wondering if there can be done any setting in order to skip videos from the download (playlist) when showing up errors as for example videos set on private or deleted content.

Thanks

도커이미지를 받으면 항상 2GB로 받아옵니다

asd

시놀로지 도커에서 youtube-dl-nas를 latest으로 받으면 항상 2GB로 고정되서 받아옵니다
분명 630.33 MB으로 받아야 할텐데 이상합니다

혹시 몰라서 2GB 이미지로 만들경우, 포트 설정이 기본값 8080으로 고정되며,
시놀로지의 docker 폴더에 해당 youtube-dl-nas의 파일이 생성되지 않았습니다.

다른 분이 만든 도커 이미지를 받을 때에는 문제 없이 사용할 수 있었습니다
혹시 해결방법이 없을까요?

/websocket returns 500 internal server error

It occurs from the latest docker image.

Logs from the docker instance:

Traceback (most recent call last):

  File "/usr/local/lib/python3.6/site-packages/bottle.py", line 868, in _handle
    return route.call(**args)

  File "/usr/local/lib/python3.6/site-packages/bottle.py", line 1748, in wrapper
    rv = callback(*a, **ka)

  File "/usr/src/app/bottle_websocket/plugin.py", line 5, in wrapper
    callback(request.environ.get('wsgi.websocket'), *args, **kwargs)

  File "/usr/src/app/youtube-dl-server.py", line 59, in echo
    msg = WSAddr.wsClassVal.receive()

  AttributeError: 'NoneType' object has no attribute 'receive'

download is extremly slow

i noticed that the download speed is extremely slow (max:63.2 kbit/s)
is there is a solution for this
note: used different ISP and different machine but the same results

Can audio only download be supported?

Hi, thank you for your work, it's awesome!
It would be so great to also have a "bestaudio" download feature!
I know that youtube-dl supports this so maybe it wouldn't be hard to implement?

error: Unable to extract uploader id

Hello everyone,

i installed the image edebont/youtube-dl-nas for docker on raspberry pi 4 64 bit, this went without any problems, in the container logs i see the following error: Unable to extract uploader id.

how could i solve the problem?

thanks in advance

regards.

music quality

Is there a way to select the music quality for MP3 at least from the command line?

Bookmarklet Support

Hey, thank you for putting this together! I am wondering if it would be possible to add a bookmarklet feature, that when clicked, would send the current page URL to my youtube-dl-nas instance.

재생목록 다운로드 시 Error 발생

4F2B577E-721F-40E0-BE22-40270486D1BA

재생목록으로 다운로드 시 이유는 모르겠으나
일부 재생목록에서 위와 같은 에러 발생으로
다시 프로세스를 죽였다가 다시 살려야 하고
이후에도 동일 합니다.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.