zaps166 / QMPlay2

QMPlay2 is a video and audio player which can play most formats and codecs.
GNU Lesser General Public License v3.0
840 stars 174 forks source link

Add support of cookies arguments commands of yt-dlp "--cookies-from-browser firefox" to play restircted videos of twitter #756

Open trimechee opened 1 month ago

trimechee commented 1 month ago

Hello, yesterday i tried to play twitter videos because videos on twitter are very heavy and lag freeze even lowest quality in my old laptop, i tried with Qmplay2, smplayer, potplayer with 3DYD Youtube Source plugin, mpc hc, mpc be, qmplay2...all these players fails to pay twitter videos and have message that i should add cookies commands like --cookies-from-browser firefox....

i am not expert, i tired to add --cookies-from-browser firefox to the yt-dlp engines of these media players but no video playback :(

my idea please is that media player allows to support or add cookies yt-dlp commands arguments --cookies-from-browser firefox --cookies-from-browser chrome --cookies-from-browser r3dfox ........to video stream detected so we can avoid possible bugs and we could playback restirctid videos of twitter in vlc or potplayer or smplayer...thank you very much!

zaps166 commented 1 month ago

Hello, could you try this:

diff --git a/src/qmplay2/YouTubeDL.cpp b/src/qmplay2/YouTubeDL.cpp
index fd4a5d24..c64eb6d1 100644
--- a/src/qmplay2/YouTubeDL.cpp
+++ b/src/qmplay2/YouTubeDL.cpp
@@ -63,6 +63,7 @@ QStringList YouTubeDL::getCommonArgs()
     QStringList commonArgs {
         "--no-check-certificate", // Ignore SSL errors
         "--user-agent", Functions::getUserAgent(),
+        "--cookies-from-browser", "firefox",
     };

     const char *httpProxy = getenv("http_proxy");

?

trimechee commented 4 weeks ago

Sorry I didn't understand well, i.e. I click on ctrl+u and I put all that?

before doing that, I try with a link of a normal youtube video because I suceeded to watch bein sport live channel during the olympics games with QMPlay2 but I didn't try with a normal youtube video and it works !!!

Our so bloved QMPlay2 can playback youtube video in my windows 7 SP1 32 bits without the need of comand cookies-from-browser firefox chrome !!!! I don't know what changed, maybe new version of yt-dlp, also recently I uninstalled python (installed by elephant extension of FDM).....

I just proposed this idea of ​​being able to add this command cookies-from-browser firefox in case there would be a future playback problem in the future, in addition I recently read a thread that advises against adding this command cookies-from-browser firefox chrome because youtube will block the video so cookies-from-browser firefox seems to have the opposite effect !!

a user said this command cookies-from-browser firefox can work provided that we are not connected and if we are logged out of our youtube account......

but we still hope, in case youtube complicates things in the future, to be able to easily add custom command please, maybe that will solve some possible problems, for the moment I close my issue of the problem of youtube playback in windows 7 32 bits, and it's up to you to decide Mr Zaps166 if this issue of adding custom command argument should be closed or left open.....

from what I've read, youtube seems to censor only ip addresses that download or use youtube too much.....a trick I found is it seems when we use aria2c and yt-dlp together, and I even added the argument cookies-from-browser firefox, we can download youtube videos and bypass possible blocking, I have used this beautiful downloader which allows us to add custom argument command and allows to add aria2c extension and combine it with yt-dlp to prove this theory :

https://github.com/mhogomchungu/media-downloader

Thanks a lot !