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';
*/
}