Using youtube-dl with ffmpeg or How to grab YouTube video and re stream as live RTMP stream with FFMPEG
First you need install youtube-dl and ffmpeg last version (because last ffmpeg builds supports https protocol)
Here is examples how to use youtube-dl with ffmpeg
Get YouTube stream parameters:
ffmpeg -i "`youtube-dl -g https://StreamAddress`"
Restream video with h264 transcoding and push as RTMP to other streamer:
ffmpeg -re -i "`youtube-dl -g https://StreamAddress`" -preset medium -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -b:v 1300k -maxrate 2600k -bufsize 2600k -f flv rtmp://Destination_Address:1935/Stream/stream_name