if all you need is a simple dev/testing environment, follow these steps
- clone the repo
- run
docker build -t yt2009 . - after the build finishes, run
docker run -it -p 8080:80 yt2009 - navigate to http://127.0.0.1:8080
the yt2009 container is configured by using the following environment variables:
YT2009_PORTsets the HTTP port (default:80)YT2009_ENVsets the usage environment, dev is used for development purposes, prod is designed for production, adds an authentication system and is needed if you want to use the built-in SSL support (default:dev)YT2009_IPsets the IP/Hostname used that will be used to connect to yt2009, is required for legacy stuff where it has to be hardcoded (default:127.0.0.1)
for YT2009_IP, if you intend to use things like the mobile app, make sure to set it to an address those devices can access!
you're most likely looking at using your public IP provided you can port forward.
YT2009_SSLallows you to enable built-in SSL support, requires prod env to work! (default:false)YT2009_SSLPORTsets the HTTPS port (default:443)YT2009_SSLPATHsets the path for the SSL certificate (default:/yt2009/cert.crtwhich is linked to/data/cert.crtso you can use either)YT2009_SSLKEYsets the path for the SSL certificate private key (default:/yt2009/cert.keywhich is linked to/data/cert.keyso you can use either)YT2009_AUTO_MAINTAINsets whether to enable automatic instance cleaning (default: false)YT2009_MAINTAIN_MAX_SIZEsets the maximum assets folder size in GB, works with auto_maintain (default: 10)YT2009_MAINTAIN_MAX_CACHE_SIZEsets the maximum cache file size in MB, works with auto_maintain (default: 15)YT2009_FALLBACKsets fallback mode, doesn't use the saved cache, shows a fallback notice on homepage, deprecated (default: false)YT2009_MASTERSERVERsets a different master server for comments/video sync, leave empty to disableYT2009_DISABLEMASTERsets whether any master server will be used (default: false)YT2009_LOCKED_TOKENSsets access tokens that will be redirected to /t.htm, separated by commas, leave empty to disableYT2009_HOMEPAGETEXTsets a custom text that will be shown on the homepage, leave empty to disableYT2009_REDIRsets an absolute http path of a different yt2009 instance you wish to redirect to, leave empty to disableYT2009_LOGGED_TOKENSsets tokens that have their usage logged in/data/accessdata, separated by commas, leave empty to disableYT2009_TOKENSallows you to specify custom auth tokens instead of generating them randomly, requires prod env to work!, separated by commas, leave empty to disable, this will override any existing access tokens when used!!!YT2009_RATELIMITsets a number of web fetch (watch, search etc) requests one ipv4 address/one ipv6 block can make in a minuteYT2009_GDATA_AUTHallows you to enable token-based authorization for the gdata api (e.g. mobile apps) (default:false)YT2009_REENCODE_DEVSsets a list of user-agent parts to reencode mp4 videos to h264 baseline (more compatibility with older devices). comma-separaed. don't enter to disable.YT2009_TRUSTEDCONTEXTsets whether to require additional "context" data in mp4 video links to download them. true/false (default:false)YT2009_TCOVERRIDEsets a key that can be used to override trusted context. more info in yt2009trustedcontext.js. don't enter to not use a key.YT2009_DATA_API_KEYaccepts a google data api v3 key for proper categories to show in video descriptions.YT2009_FILE_LIMITsets a number in MB of max upload size. (default: 10)YT2009_DEFAULTFsets whether new browsing sessions should have fmode enabled by default. (default:false)YT2009_DEFAULTFH264sets whether new browsing sessions should have h264 enabled for flash. (default:false)YT2009_DLMAXRETRY- the maximum number of retries of file fragment (default: 5)YT2009_MAX1080- limits the quality to 1080p from the html5 quality picker (available withwatch_modern_features)true/false(default:false)YT2009_IPV6- a string containing an ipv6 subnet you want yt2009 to rotate through for playback. (e.g.2a01:4f8:xxxx:xxxx)YT2009_ALTHOSTNAME- allows using a different hostname, enabling hostsfile redirect to youtube.com. ONLY TO BE USED AFTER INITIAL SETUP.true/false
auth tokens are located in /yt2009/back/config.json, you can use this command to read them: docker exec [container name] cat /yt2009/back/config.json
if you want your data to be saved when the container is removed, mount /data to a directory or volume
for example: docker run --rm -p 80:80 -v ~/yt2009data:/data -e YT2009_ENV=prod yt2009