ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.38k stars 9.96k forks source link

AttributeError when trying to download a video from Facebook #30681

Open krnlexception opened 2 years ago

krnlexception commented 2 years ago

Checklist

Verbose log

E:\Pobrane>youtube-dl --cookies cookies.txt -v https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--cookies', 'cookies.txt', '-v', 'https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479']
[debug] Encodings: locale cp1250, fs utf-8, out utf-8, pref cp1250
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.9.7 (CPython) - Windows-10-10.0.22557-SP0
[debug] exe versions: none
[debug] Proxy map: {}
[facebook] 702961650712479: Downloading webpage
Traceback (most recent call last):
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\Scripts\youtube-dl.exe\__main__.py", line 7, in <module>
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\__init__.py", line 475, in main
    _real_main(argv)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\__init__.py", line 465, in _real_main
    retcode = ydl.download(all_urls)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2068, in download
    res = self.extract_info(
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 808, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\facebook.py", line 680, in _real_extract
    return self._extract_from_url(real_url, video_id)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\facebook.py", line 499, in _extract_from_url
    parse_attachment(attachment)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\facebook.py", line 480, in parse_attachment
    media = attachment.get(key) or {}
AttributeError: 'NoneType' object has no attribute 'get'

Description

When trying to download a video from private Facebook group, I get an Attribute error saying that object has no attribute get. cookies.txt are extracted from Facebook cookies via a Firefox extension (tested with --username and --password as well)

krnlexception commented 2 years ago

I see previous comments were removed, so I'm just going to restate my original point. If you wish for help, you're going to need to provide username and password, or cookies. People need to be able to access the video somehow, to fix the extractor. This could mean you making a dummy account and posting your own private video, or similar methods. But unless people can access the video you're talking about, its going to be difficult to help.

Once again: I'm not gonna give out my account credentials to some random on the internet (thus giving also my personal information). I can give link to the group video is on, but I'm not gonna give out my Facebook account

krnlexception commented 2 years ago

No one here cares about your personal information.

Still it's my PERSONAL account, and also with that account I use a password that I use with a lot of sites so yeah XD. You can just join the group the video is on. I would also need to join it from a dummy account so no diffrence XD

krnlexception commented 2 years ago

Look at this:

https://github.com/ytdl-org/youtube-dl/search?q=label:account-needed&state=open&type=issues

nearly 200 issues that are open for the same reason.

You could just join the group. But you're too lazy to do that and try to get someone's account on Facebook. https://www.google.com/search?channel=nrow5&client=firefox-b-d&q=why+you+shouldn%27t+give+your+account+info+to+some+random+people+on+the+internet <-- read this

krnlexception commented 2 years ago

And also as I remember correctly, you don't want to help anymore so why do you give a shit about this issue XD and try to persuade me into giving my account away

obraz

krnlexception commented 2 years ago

I have put countless hours into developing several extractors, so I dont think lazy would be a good way to describe me.

Yeah it is

krnlexception commented 2 years ago

And also you can't see that owners of this repo are deleting your comments because you're trying to get into my personal Facebook account? Or you're too dumb (because I can't put your way of thinking in any other way) to see that and still think that people are giving their accounts to some random strangers on the internet

If you really would want to help, you would just join the group (it's in Polish though, but I would be happy to help with joining), and help me, not try to get my Facebook account (with my personal info, even though you don't care about my personal information)

If you are a programmer (judging by "I have put countless hours into developing several extractors" you are), you should also know the basics of security of your accounts, and one of the most basic things is to not give your login and passwords to sites to random people on the internet.

krnlexception commented 2 years ago

I am not a random person, I have developed several extractors, which you can see from my profile page.

Yes you ARE because I DON'T know you, and you are a stranger to me.

obraz

And I am not trying to "get into your account", I am just trying to help.

No? obraz

Again, if you dont want to share account information, even for a dummy account, thats your choice.

You can join the group that the video is on, and it would be faster than me making a brand new account.

krnlexception commented 2 years ago

You can join the group that the video is on, and it would be faster than me making a brand new account.

Youre the one who needs help. You should be making the process easy for people trying to help, not the other way around.

I would, that's why I said that I would assist you with joining the group (because it's in Polish) to make it easy for you. I simply do not trust you with giving my account because I don't know what you could do on it.

krnlexception commented 2 years ago

And why still do you give a shit about this issue even you don't want to help, you're just wasting my time.

krnlexception commented 2 years ago

If you do not want to share credentials on main account, please provide credentials for dummy account. Thank you.

I would have to make that account + join the group, which you could also do.

If you still want access to my account, give access to yours, then I will give access to mine.

october262 commented 2 years ago

Checklist

  • [x] I'm reporting a broken site support issue
  • [x] I've verified that I'm running youtube-dl version 2021.12.17
  • [x] I've checked that all provided URLs are alive and playable in a browser
  • [x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • [x] I've searched the bugtracker for similar bug reports including closed ones
  • [x] I've read bugs section in FAQ

Verbose log

E:\Pobrane>youtube-dl --cookies cookies.txt -v https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--cookies', 'cookies.txt', '-v', 'https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479']
[debug] Encodings: locale cp1250, fs utf-8, out utf-8, pref cp1250
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.9.7 (CPython) - Windows-10-10.0.22557-SP0
[debug] exe versions: none
[debug] Proxy map: {}
[facebook] 702961650712479: Downloading webpage
Traceback (most recent call last):
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\Scripts\youtube-dl.exe\__main__.py", line 7, in <module>
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\__init__.py", line 475, in main
    _real_main(argv)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\__init__.py", line 465, in _real_main
    retcode = ydl.download(all_urls)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 2068, in download
    res = self.extract_info(
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 808, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\facebook.py", line 680, in _real_extract
    return self._extract_from_url(real_url, video_id)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\facebook.py", line 499, in _extract_from_url
    parse_attachment(attachment)
  File "C:\Users\nolemretaW\AppData\Local\Programs\Python\Python39\lib\site-packages\youtube_dl\extractor\facebook.py", line 480, in parse_attachment
    media = attachment.get(key) or {}
AttributeError: 'NoneType' object has no attribute 'get'

Description

When trying to download a video from private Facebook group, I get an Attribute error saying that object has no attribute get. cookies.txt are extracted from Facebook cookies via a Firefox extension (tested with --username and --password as well)

play the video and click the 3 dots ... in the upper right hand corner of the video select copy link and see if that'll work in downloading the video.

krnlexception commented 2 years ago

Still doesn't work

october262 commented 2 years ago

https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479

copy this link - https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479 now, open a new browser tab, paste the link and change www to mbasic, will the video now play ??

krnlexception commented 2 years ago

https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479

copy this link - https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479 now, open a new browser tab, paste the link and change www to mbasic, will the video now play ??

yes

october262 commented 2 years ago

https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479

copy this link - https://www.facebook.com/stoneheart.sakamaki/videos/702961650712479 now, open a new browser tab, paste the link and change www to mbasic, will the video now play ??

yes

does right clicking on the video give you the option to save the video ?? you may have to have a browser add-on that allows right click.

krnlexception commented 2 years ago

it allows but it tries to save as htm file, used 4k video downloader to download the actual video

dirkf commented 2 years ago

Regardless of all the above, the original issue looks like the same problem as #30650 and #30474.