Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with using --Cookies #47

Closed
Hawkins1212 opened this issue Sep 2, 2021 · 14 comments
Closed

Issue with using --Cookies #47

Hawkins1212 opened this issue Sep 2, 2021 · 14 comments

Comments

@Hawkins1212
Copy link

Trying to pull a video from DiscoveryPlus using link and receive an error:
image

I've reviewed and I believe I need to use the command line --cookies and link it to the cookies for my URL after I login. I've done this and pulled the info into a "cookies.txt" file.

Then I go into the console of Metube in Unraid and type the command:/app # yt-dlp --cookies cookies.txt https://www.discoveryplus.com/video/...." which should pull the video file. When I do this, I get the same error: "This video is only available for registered users. You may want to use --cookies."

I am guessing my cookies file is not being found by Metube. What directory do we put the cookies file in so Metube can find it?

Thanks,

@alexta69
Copy link
Owner

alexta69 commented Sep 2, 2021

If you're using the yt-dlp command line, then why do you need MeTube? It'll be a lot easier to just download it and use it directly. In order to use it from inside MeTube, you have to mount the cookies.txt file from the outside. And also make sure it downloads into an externally mounted folder. But again, it will be a lot simpler to not use MeTube at all, and just use yt-dlp.

@Hawkins1212
Copy link
Author

Hawkins1212 commented Sep 2, 2021

I guess that's valid however, I prefer to use MeTube if possible due to the GUI, ease of use with Unraid, etc. I've never used yt-dlp and simply went to the command lines only to see if I can figure out the cookies issue. The GUI worked perfectly for me for "non-registered" items like youtube, etc. and I am looking to expand the use to Discovery Plus.
Currently, I have my downloads going to my cache drive mounted folder. When you indicate I need to mount cookies.txt file from the outside, I am not sure I understand what you mean. Is this something that's set up (ie. port, variable, etc) in Unraid? I am more of a novice and trying to figure things about but a kick in the right direction would be helpful.

Thanks for your time!

@alexta69
Copy link
Owner

alexta69 commented Sep 2, 2021

I'm not familiar with Unraid specifically, so I can't really say how exactly it's done there. But the idea is that just as you mount your /downloads folder as a docker volume, you need to mount the cookies file into the container in the same way (as a volume). Let's say you mount it in the root directory as /cookies.txt in the container. Then you can instruct the yt-dlp copy that MeTube runs to use this cookie file. That you will have to do via the YTDL_OPTIONS environment variable. You'll have to set it to {"cookiefile":"/cookies.txt"}. If you're doing it directly via YAML, make sure you properly escape this string. This is the MeTube side of things; as to how to make all this happen in Unraid I don't know -- perhaps ask someone who's familiar with that platform, forward them these instructions and maybe they can translate them into the Unraid system.

@Hawkins1212
Copy link
Author

Thank you. I appreciate your time in helping this. I'll take what you said do do some trial and error. Thanks!

@Hawkins1212
Copy link
Author

You mentioned "YTDL_OPTIONS" as being the environment variable value; however the logs say "YTDL_OPTIONS is invalid"

Is this meant to be YTDL_FORMAT_OPTIONS?

@alexta69
Copy link
Owner

alexta69 commented Sep 2, 2021

I just answered in the Unraid forums thread (I guess it doesn't show yet because it has to go through moderation). I'll paste it here as well:

@hawkins12, as I said I know nothing about Unraid but still these don't look right... In the mount section, I think you want to use /mnt/user/Downloads/MeTube/cookies.txt as the host path. And in the environment variable section, you'll probably want YTDL_OPTIONS as the key, and the JSON string {"cookiefile":"/cookies.txt"} as the value.

@auanasgheps
Copy link
Contributor

Hi, I'm having trouble using this option, coming from #32

  • So I've installed the extension Get Cookies
  • Extracted Tiktok cookies
  • Mapped the folder that contains the cookie file
    immagine
  • Verified the file is seen in the container
    immagine

However, TikTok videos still fail.
immagine

This is the first time doing this so I might be missing something obvious.
I'm trying with a generic video like this one

@alexta69
Copy link
Owner

Can you try running yt-dlp from the command line within the container to download the video, specifying the cookie file via the --cookies argument? This will tell us whether it's a general problem with yt-dlp not being able to use these cookies to download the video properly, or whether it's a specific problem with the way MeTube invokes yt-dlp.

@auanasgheps
Copy link
Contributor

Can you try running yt-dlp from the command line within the container to download the video, specifying the cookie file via the --cookies argument? This will tell us whether it's a general problem with yt-dlp not being able to use these cookies to download the video properly, or whether it's a specific problem with the way MeTube invokes yt-dlp.

Can I do this from the container terminal or should I install yt-dlp on my PC?

@alexta69
Copy link
Owner

Within the container (the same place where you checked for the existence of the cookie file in the screenshot above, I assumed you used docker exec to run a shell within the container, right?)
You should have the yt-dlp command ready there.

@auanasgheps
Copy link
Contributor

So ironic, Tiktok is down now. Will try later!

@auanasgheps
Copy link
Contributor

Yes, I get the same error. Should I file an issue with yt-dlp?
Here's a verbosed screenshot
immagine

@auanasgheps
Copy link
Contributor

EDIT: ok, it's broken in yt-dlp 2021.09.02. they have already committed the fix but it's yet to be released.

yt-dlp/yt-dlp#971

Apparently TikTow won't even require a cookie.

Sorry for jumping in this case.

@alexta69
Copy link
Owner

No problem. Glad you figured it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants