Страница 1 из 1

yt-dlp (youtube-dl)

Добавлено: 24 авг 2023, 06:46
ya
1. Скачать youtube-dl
https://github.com/yt-dlp/yt-dlp/releases/download/2022.05.18/yt-dlp.exe

2. обновить
yt-dlp -U

3. Воспроизвести:
yt-dlp -o - "ссылка на ресурс в инэте с видосом, например ютуб" | play2

список поддерживаемых сайтов:
https://ytdl-org.github.io/youtube-dl/supportedsites.html

Видео-плеер под ffplay можно скомпилировать g++ play2.cpp

Код: Выделить всё

#include <iostream>
#include <string>
 
int main(int argc, char* argv[])
{
    using namespace std::literals;
	if (argc != 2 ) exit (1);
    // Creating a string from const char*
    //std::string str1 = "hello";
	std::string str1 = "ffplay -i ";
 
    // Creating a string using string literal
    //auto str2 = "world"s;
    auto str2 = " -vf \"scale=1100:-1,drawtext=text='%{pts\\:hms}':box=1:fontcolor=black:shadowcolor=white:shadowx=1:shadowy=1:fontsize=16:x=(w-tw)-(lh):y=h-(2*lh)\" -autoexit -stats "s;
 
    // Concatenating strings
    //std::string str3 = str1 + " " + str2;
    std::string str3 = str1 + "\"" + argv[1] + "\"" + str2;
 
    // Print out the result
    std::cout << str3 << '\n';
 
	const char * c = str3.c_str();
	system(c);
    /*
	std::string::size_type pos = str3.find(" ");
    str1 = str3.substr(pos + 1); // the part after the space
    str2 = str3.substr(0, pos);  // the part till the space
 
    std::cout << str1 << ' ' << str2 << '\n';
 
    // Accessing an element using subscript operator[]
    std::cout << str1[0] << '\n';
    str1[0] = 'W';
    std::cout << str1 << '\n';
	*/
}

Re: yt-dlp (youtube-dl)

Добавлено: 08 фев 2025, 18:34
ya

Код: Выделить всё

yt-dlp --update-to 2023.10.07

Re: yt-dlp (youtube-dl)

Добавлено: 22 апр 2025, 06:48
ya
Установить плагин Get cookies.txt LOCALLY и со страницы ютуба в браузере экспортировать файл куков
https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc

Код: Выделить всё

apt install pip
pip install yt-dlp
yt.sh url-youtube

Код: Выделить всё

#!/bin/bash

if [ $# -ne 1 ]; then
	echo "Error: Invalid number of arguments URL"
 	exit 1
fi


yt-dlp -v \
-f "bv*[height<=1080][ext=mp4][vcodec^=avc1]+ba*[ext=m4a]" \
--cookies youtube.com_cookies.txt \
--no-overwrites \
--continue "$1"

exit 0

Если ваш прокси-сервер находится по адресу

Код: Выделить всё

-p "http://myuser:mypassword@myproxy.com:8080"