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

youtube-dl unable to download private vk video do to allegedly invalid credentials #31035

Open dmitrybalsy opened 2 years ago

dmitrybalsy commented 2 years ago

Checklist

Question

WRITE QUESTION HERE I am trying to download a video with my vk login credential but it fails do to invalid credentials. I am able to log in to my account using the same credentials that are returned in the failed youtube-dl pull request

here is the command line

youtube-dl -v -u <email/phone_number> -p <password>  -vg "https://vk.com/video-133441491_456261066"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-u', 'PRIVATE', '-p', 'PRIVATE', '-vg', 'https://vk.com/video-133441491_456261066']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.8.10 (CPython) - Linux-5.13.0-1023-aws-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Proxy map: {}
# I edit file /usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/vk.py with:
#     def _login(self):
#        username, password = self._get_login_info()
#        print("-----------------------")
#        print(username)
#        print(password)
-----------------------
<username> # Used this username (copy/paste) to log in to my account via web UI 
<password>  # Used this password (copy/paste) to log in to my account via web UI 
ERROR: Unable to login, incorrect username and/or password
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/common.py", line 533, in extract
    self.initialize()
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/common.py", line 437, in initialize
    self._real_initialize()
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/vk.py", line 66, in _real_initialize
    self._login()
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/vk.py", line 62, in _login
    raise ExtractorError(
youtube_dl.utils.ExtractorError: Unable to login, incorrect username and/or password

From what I found is that this should be working, and it is very likely that it is my credentials, but I was able to validate my credentials by login in with it to vk. Maybe my credentials need to wrapped in some chars like ' or " or some other char?

dmitrybalsy commented 2 years ago

@89z that was the case until a few days ago, then I started to get this error

youtube-dl -v -vg "https://vk.com/video-133441491_456261066"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-vg', 'https://vk.com/video-133441491_456261066']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.8.10 (CPython) - Linux-5.13.0-1023-aws-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Proxy map: {}
-----------------------
None
None
ERROR: This video is only available for registered users. Use --username and --password or --netrc to provide account credentials.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/vk.py", line 328, in _real_extract
    payload = self._download_payload('al_video', video_id, data)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/vk.py", line 75, in _download_payload
    self.raise_login_required()
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/common.py", line 941, in raise_login_required
    raise ExtractorError(
youtube_dl.utils.ExtractorError: This video is only available for registered users. Use --username and --password or --netrc to provide account credentials.
dirkf commented 2 years ago

As I just wrote in the previous issue:

As a rule, the login function of any extractor is liable to break because sites change the procedure, by adding captchas or whatever. If the login function doesn't succeed, or even always, omit -u .../--username ... and use --cookies ....

If, as I understand it, you disabled the login function, that applies in Spades.

dmitrybalsy commented 2 years ago

@dirkf If I did disabled the login function it would be unintentional and unlikely. Where do I check for that? This comes from within a tool I written. That code has not changed. It worked in the beginning of the week. I think vk updated their back end and by doing so it broke youtube-dl (vk portion of it). The problem with this theory (vk changed its backend) is that I could not find any recent activity in changelog.
The original problem was not even a login. It failed to pull public video with an error saying that the video is private. youtube_dl.utils.ExtractorError: This video is only available for registered users. Use --username and --password or --netrc to provide account credentials. I tried using my credentials and it failed with them too. youtube_dl.utils.ExtractorError: Unable to login, incorrect username and/or password I tried redownloading the video that I was able to download before. It produced the same error.

dirkf commented 2 years ago

You wrote:

# I edit file /usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py with: # def _login(self): # username, password = self._get_login_info() # print("-----------------------") # print(username) # print(password)

If that means you commented out the YoutubeDL._login() method, then anything could happen.

The extractor diagnostics are confusing because it doesn't suggest using the --cookies ... option which is the most likely to succeed when --username ... fails.

Anyhow there are further new site issues that will break VK extraction: see https://github.com/yt-dlp/yt-dlp/issues/4097.

dmitrybalsy commented 2 years ago

oo no, sorry for the confusion I commented that out for the output showing this is what is happening in the background (and not a part of the stderr) and the credentials that are printed out I used to log in via UI. Thank you for sharing the link. snippet from the code and actually I pasted in a wrong file this is the file edited /usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/vk.py

Screen Shot 2022-06-19 at 10 35 47 AM
ivanioannovich commented 2 years ago

Vk change login page. Cookies don't work.

valk89 commented 2 years ago

They're using some really tight code to prevent downloads of their livestreams. It seems difficult for any app or program to generate even a downloadable link or alternative stream link, even the ones that guarantee it.

PrimeMK105 commented 2 years ago

image So not only me getting error about downloading vk video? I created _netrc, created config file, tried to use -u -p/--username --password but yet it getting me this error

dirkf commented 2 years ago

No, it's a general issue with VK as other commenters have noted; see the link in https://github.com/ytdl-org/youtube-dl/issues/31035#issuecomment-1159733957.

dirkf commented 2 years ago

From https://github.com/ytdl-org/youtube-dl/issues/31041#issue-1277401990:

The authentication algorithm on the site vk.com changed. Now on the start page in the input form you need to specify only the login, after clicking on the button in the next form you need to enter only the password. Please correct the authentication for vk.com in your module vk.py

novikalexy commented 2 years ago

Does anyone know another way to download videos from vk.com by python?

dirkf commented 2 years ago

Vk change login page. Cookies don't work.

How not? (Remember to not use -u .../--username ...)

jfdelerue commented 2 years ago

For me, nor youtube-dl -u ... -p ... , youtube-dl -n or cookies works.

novikalexy commented 2 years ago

For me, nor youtube-dl -u ... -p ... , youtube-dl -n or cookies works.

Please tell us the details how you use cookies for downloading from vk.com? I tried to save cookies by the chrome extension (get cookies.txt), but I got an error:

youtube-dl -v --cookies vk.com_cookies.txt https://vk.com/video-31480508_456243099
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--cookies', u'vk.com_cookies.txt', u'https://vk.com/video-31480508_456243099']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 2.7.18 (CPython) - Darwin-21.1.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 5.0.1, ffprobe 5.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[vk] -31480508_456243099: Downloading JSON metadata
ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

What am I doing wrong?

backpac commented 2 years ago

What am I doing wrong?

You're doing everything right, the VK has changed something...

dirkf commented 2 years ago

There are two issues:

  1. The site's login workflow has changed, as above, but someone with a VK account will have to fix it.
  2. The request that the extractor uses to fetch video data, except for embedded videos, no longer works, and has to be re-worked as in https://github.com/yt-dlp/yt-dlp/pull/4128.

Consequently:

This patch fixes the extractor for public videos and should, I hope, enable private videos with --cookies ... as well (it also includes _VALID_URL improvements from yt-dlp).

--- old/youtube_dl/extractor/vk.py
+++ new/youtube_dl/extractor/vk.py
@@ -16,6 +16,7 @@
     orderedSet,
     str_or_none,
     str_to_int,
+    try_get,
     unescapeHTML,
     unified_timestamp,
     url_or_none,
@@ -64,10 +65,14 @@

     def _download_payload(self, path, video_id, data, fatal=True):
         data['al'] = 1
+        url = 'https://vk.com/%s.php' % path
         code, payload = self._download_json(
-            'https://vk.com/%s.php' % path, video_id,
+            url, video_id,
             data=urlencode_postdata(data), fatal=fatal,
-            headers={'X-Requested-With': 'XMLHttpRequest'})['payload']
+            headers={
+                'X-Requested-With': 'XMLHttpRequest',
+                'Referer': url,
+            })['payload']
         if code == '3':
             self.raise_login_required()
         elif code == '8':
@@ -87,22 +92,22 @@
                             )
                             ext\.php\?(?P<embed_query>.*?\boid=(?P<oid>-?\d+).*?\bid=(?P<id>\d+).*)|
                             (?:
-                                (?:(?:m|new)\.)?vk\.com/(?:.+?\?.*?z=)?video|
+                                (?:(?:m|new)\.)?vk\.com/(?:.+?\?.*?z=)?video|clip|
                                 (?:www\.)?daxab.com/embed/
                             )
-                            (?P<videoid>-?\d+_\d+)(?:.*\blist=(?P<list_id>[\da-f]+))?
+                            (?P<videoid>-?\d+_\d+)(?:.*\blist=(?P<list_id>[\da-f]+|ln-[\da-zA-Z]+))?
                         )
                     '''
     _TESTS = [
         {
             'url': 'http://vk.com/videos-77521?z=video-77521_162222515%2Fclub77521',
-            'md5': '7babad3b85ea2e91948005b1b8b0cb84',
+            'md5': '56df4e32658e1ffb77fdf2548327f73a',
             'info_dict': {
                 'id': '-77521_162222515',
                 'ext': 'mp4',
                 'title': 'ProtivoGunz - Хуёвая песня',
                 'uploader': 're:(?:Noize MC|Alexander Ilyashenko).*',
-                'uploader_id': '-77521',
+                'uploader_id': '39545378',
                 'duration': 195,
                 'timestamp': 1329049880,
                 'upload_date': '20120212',
@@ -124,7 +129,7 @@
         {
             'note': 'Embedded video',
             'url': 'https://vk.com/video_ext.php?oid=-77521&id=162222515&hash=87b046504ccd8bfa',
-            'md5': '7babad3b85ea2e91948005b1b8b0cb84',
+            'md5': '56df4e32658e1ffb77fdf2548327f73a',
             'info_dict': {
                 'id': '-77521_162222515',
                 'ext': 'mp4',
@@ -133,7 +138,7 @@
                 'duration': 195,
                 'upload_date': '20120212',
                 'timestamp': 1329049880,
-                'uploader_id': '-77521',
+                'uploader_id': '39545378',
             },
         },
         {
@@ -180,6 +185,19 @@
                 'view_count': int,
             },
             'skip': 'Removed',
+        },
+        {
+            'url': 'https://vk.com/video-93049196_456239755?list=ln-cBjJ7S4jYYx3ADnmDT',
+            'info_dict': {
+                'id': '-93049196_456239755',
+                'ext': 'mp4',
+                'title': '8 серия (озвучка)',
+                'duration': 8383,
+                'timestamp': 1640162189,
+                'upload_date': '20211222',
+                'uploader': 'Dizi2021',
+                'uploader_id': '-93049196',
+            },
         },
         {
             # video (removed?) only available with list id
@@ -227,6 +245,7 @@
             'params': {
                 'skip_download': True,
             },
+            'skip': 'This video has been deleted',
         },
         {
             # video key is extra_data not url\d+
@@ -254,8 +273,6 @@
                 'title': 'ИгроМир 2016 День 1 — Игромания Утром',
                 'uploader': 'Игромания',
                 'duration': 5239,
-                # TODO: use act=show to extract view_count
-                # 'view_count': int,
                 'upload_date': '20160929',
                 'uploader_id': '-387766',
                 'timestamp': 1475137527,
@@ -297,6 +314,10 @@
         {
             # The video is not available in your region.
             'url': 'https://vk.com/video-51812607_171445436',
+            'only_matching': True,
+        },
+        {
+            'url': 'https://vk.com/clip30014565_456240946',
             'only_matching': True,
         }]

@@ -314,7 +335,7 @@
         mv_data = {}
         if video_id:
             data = {
-                'act': 'show_inline',
+                'act': 'show',
                 'video': video_id,
             }
             # Some videos (removed?) can only be downloaded with list id specified
@@ -323,8 +344,10 @@
                 data['list'] = list_id

             payload = self._download_payload('al_video', video_id, data)
+            opts = try_get(payload, lambda x: x[-1], dict)
+            if not opts:
+                raise ExtractorError('Invalid payload data')
             info_page = payload[1]
-            opts = payload[-1]
             mv_data = opts.get('mvData') or {}
             player = opts.get('player') or {}
         else:
novikalexy commented 2 years ago
def _download_payload(self, path, video_id, data, fatal=True):

It works! Thank you!

dmitrybalsy commented 2 years ago

this is great @dirkf, I update the file with the changes but unfortunately I do to see the download happening I get this instead

youtube-dl -vg "https://vk.com/video-133441491_456261193"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-vg', 'https://vk.com/video-133441491_456261193']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.8.10 (CPython) - Linux-5.13.0-1023-aws-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best
https://vkvd262.mycdn.me/expires/1656117961051/srcIp/54.242.237.254/pr/40/srcAg/CHROME/ms/45.136.20.183/type/3/sig/eQKgW9u4xMs/ct/8/urls/185.226.53.172/clientType/13/zs/43/id/2634730506936/video/
dmitrybalsy commented 2 years ago

@dirkf I think it was my mistake with the command line. Once I ran my tool that uses it as a lib it worked

youtube_dl.YoutubeDL({"outtmpl": file_path}).download(
                    [self.video_files_contents[video]["source_link"]]

thank you for getting this resolved. I am assuming that at some point this will be a part of the rc build?

dirkf commented 2 years ago

-g/--get-url just prints the download link(s).

There will be a PR. If someone manages to fix the login soon, I'll add that before merging. Then, real soon now, a 2022.0n.mm release.

AlgorithmAlchemy commented 2 years ago

я всё сделал по гайду обновил но. пишет опять тоже самое [vk] 77496727_456240355: Downloading JSON metadata ERROR: This video is only available for registered users. Use --username and --password or --netrc to provide account credentials.

AlgorithmAlchemy commented 2 years ago

вы можете просто файл загрузить куда-то целиком, а не кусками. может я не туда вставил что-то

dirkf commented 2 years ago

я всё сделал по гайду обновил но. пишет опять тоже самое [G Translate] I did everything on the guide, I updated but. writes again the same [my Translate] I did everything according to the guide, I updated, but still get the same result ...

вы можете просто файл загрузить куда-то целиком, а не кусками. может я не туда вставил что-то [G Translate]You can just download the file somewhere, not in pieces. maybe I put something in the wrong place

Here I'm not sure what point the commenter is making.

Read https://github-com.translate.goog/ytdl-org/youtube-dl/issues/31035?_x_tr_sl=auto&_x_tr_tl=ru&_x_tr_hl=en#issuecomment-1161719063.

Don't expect the released version to work at the moment without patching.

Even then, don't expect the login or netrc functions to work: use cookies instead.

Post your verbose log (use -v/--verbose option) if it's significantly different from that already posted.

[G Translate]

Читайте https://github.com/ytdl-org/youtube-dl/issues/31035#issuecomment-1161719063`.

Не ожидайте, что выпущенная версия будет работать сейчас без исправления. Даже тогда не ожидайте, что функции входа в систему или NETRC будут работать: вместо этого используйте файлы cookie. Разместите свой журнал словеса (используйте опцию `-v`/`-verbose`), если он значительно отличается от того, что уже опубликовано.
AlgorithmAlchemy commented 2 years ago

Спасибо, а есть какие-то гайды как использовать файлы cookie я не совсем понимаю как их подключить

AlgorithmAlchemy commented 2 years ago
def _download_payload(self, path, video_id, data, fatal=True):

It works! Thank you!

а что это? надо вставить куда-то?

spiral009 commented 2 years ago

I can't login , the username and password are correct

OCTAGRAM commented 2 years ago

Спасибо, а есть какие-то гайды как использовать файлы cookie я не совсем понимаю как их подключить

Нужно узнать, какой у браузера User-Agent, и указать параметр --user-agent такой же. Потом если один раз запустить с параметром --cookie vk.txt, то пока yt-dl потыкается в сайт, он создаст vk.txt с кукисами в правильном формате. Открываем в браузере список куки, в Firefox при открытом залогиненном ВКонтакте Ctrl+Shift+K, вкладка Хранилище, раздел Куки, и по одной чик-чик-чик Ctrl+C, Ctrl+V имя и значение в vk.txt, через табуляцию, как требует формат файла. С таким содержимым vk.txt можно будет качать видео. У меня получилось скачать generic движком из мобильной (m.vk.com) версии сайта, но для этого ещё в эту мобильную версию зайти надо, у мобильной свои куки, и только потом снимать куки в vk.txt

youtube-dl --cookies vk.txt --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" --force-generic-extractor https://m.vk.com/video-12345_67890

I had success with cookies method, generic extractor and a MOBILE (m.vk.com/video) version. You need to be sure saved cookies match the mobile version, so login to mobile version first in real browser

dirkf commented 2 years ago

I can't login , the username and password are correct

https://github.com/ytdl-org/youtube-dl/issues/31035#issuecomment-1179766308 applies, as well as the comment above.

Vangelis66 commented 2 years ago

FWIW, the video URI posted in the opening post,

https://vk.com/video-133441491_456261066

can be "handled" by latest yt-dlp, at least from my location (SE-Europe), without any cookies or credentials:

yt-dlp -F "https://vk.com/video-133441491_456261066"

[debug] Command-line config: ['--ffmpeg-location', '..', '--downloader-args', 'ffmpeg:-v 8 -stats', '-v', '-F', 'https://vk.com/video-133441491_456261066']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] ytdl-patched/yt-dlp version 2022.09.05.810 [47a60be] (win32_exe)
[debug] ** This build is unofficial daily builds, provided for ease of use.
[debug] ** Please do not ask for any support.
[debug] Python 3.7.9 (CPython 32bit) - Windows-Vista-6.0.6003-SP2
[debug] Checking exe version: "..\ffmpeg" -bsfs
[debug] Checking exe version: "..\ffprobe" -bsfs
[debug] exe versions: ffmpeg 4.4.1 (setts), ffprobe 4.4.1, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1670 extractors
[debug] [vk] Extracting URL: https://vk.com/video-133441491_456261066
[vk] -133441491_456261066: Downloading JSON metadata
[vk] -133441491_456261066: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7),vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for -133441491_456261066:
ID       EXT           RESOLUTION FPS |   FILESIZE   TBR PROTO | VCODEC    VBR ACODEC  ABR
------------------------------------------------------------------------------------------
hls-193  mp4           256x144     25 | ~  4.46MiB  194k m3u8  | unknown  194k unknown  0k
url240   unknown_video 240p           |                  https | unknown       unknown
hls-369  mp4           426x240     25 | ~  8.52MiB  369k m3u8  | unknown  369k unknown  0k
url360   unknown_video 360p           |                  https | unknown       unknown
hls-725  mp4           640x360     25 | ~ 16.74MiB  725k m3u8  | unknown  725k unknown  0k
url480   unknown_video 480p           |                  https | unknown       unknown
hls-1185 mp4           852x480     25 | ~ 27.35MiB 1186k m3u8  | unknown 1186k unknown  0k
url720   unknown_video 720p           |                  https | unknown       unknown
hls-2460 mp4           1280x720    25 | ~ 56.77MiB 2461k m3u8  | unknown 2461k unknown  0k
url1080  unknown_video 1080p          |                  https | unknown       unknown
hls-5058 mp4           1920x1080   25 | ~116.70MiB 5058k m3u8  | unknown 5058k unknown  0k

So, again, some backporting might be needed 😉 ... Be that as it may, I'm not sure whether yt-dlp can handle "true" private VK videos...

gsw17 commented 2 years ago

doesn't work for me in Europe

yt-dlp -F "https://vk.com/video-133441491_456261066" [vk] -133441491_456261066: Downloading JSON metadata ERROR: This video is only available for registered users. Use --cookies, --username and --password or --netrc to provide account credentials

can be "handled" by latest yt-dlp, at least from my location (SE-Europe), without any cookies or credentials:

yt-dlp -F "https://vk.com/video-133441491_456261066"
Vangelis66 commented 2 years ago

@gsw17 : Which version of yt-dlp is that on?

Both the stable yt-dlp release (2022.09.01) as well as latest "daily" build (which you can get from:

https://github.com/ytdl-patched/yt-dlp/tags )

work fine here with that sample VK URI:

yt-dlp -v -F "https://vk.com/video-133441491_456261066" --ie vk

[debug] Command-line config: ['--ffmpeg-location', '..', '--downloader-args', 'ffmpeg:-v 8 -stats', '-v', '-F', 'https://vk.com/video-133441491_456261066', '--ie', 'vk']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version 2022.09.01 [5d7c7d6] (win32_exe)
[debug] Python 3.7.9 (CPython 32bit) - Windows-Vista-6.0.6003-SP2
[debug] Checking exe version: "..\ffmpeg" -bsfs
[debug] Checking exe version: "..\ffprobe" -bsfs
[debug] exe versions: ffmpeg 4.4.1 (setts), ffprobe 4.4.1, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1 extractors
[debug] [vk] Extracting URL: https://vk.com/video-133441491_456261066
[vk] -133441491_456261066: Downloading JSON metadata
[vk] -133441491_456261066: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7),vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for -133441491_456261066:
ID       EXT           RESOLUTION FPS |   FILESIZE   TBR PROTO | VCODEC    VBR ACODEC  ABR
------------------------------------------------------------------------------------------
hls-193  mp4           256x144     25 | ~  4.46MiB  194k m3u8  | unknown  194k unknown  0k
url240   unknown_video 240p           |                  https | unknown       unknown
hls-369  mp4           426x240     25 | ~  8.52MiB  369k m3u8  | unknown  369k unknown  0k
url360   unknown_video 360p           |                  https | unknown       unknown
hls-725  mp4           640x360     25 | ~ 16.74MiB  725k m3u8  | unknown  725k unknown  0k
url480   unknown_video 480p           |                  https | unknown       unknown
hls-1185 mp4           852x480     25 | ~ 27.35MiB 1186k m3u8  | unknown 1186k unknown  0k
url720   unknown_video 720p           |                  https | unknown       unknown
hls-2460 mp4           1280x720    25 | ~ 56.77MiB 2461k m3u8  | unknown 2461k unknown  0k
url1080  unknown_video 1080p          |                  https | unknown       unknown
hls-5058 mp4           1920x1080   25 | ~116.70MiB 5058k m3u8  | unknown 5058k unknown  0k

Are you able to watch that video inside your browser? If VK geo-blocks certain European regions, then the error issued by yt-dlp should be more appropriate for such a case ...

kimryak commented 1 year ago

Hi! I still have the same issue. Here's what have:

I've verified that I'm running yt-dlp version 2023.1.6 (update instructions) or later (specify commit) I've checked that all provided URLs are playable in a browser with the same IP and same login details I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates I've read the guidelines for opening an issue

Provide a description that is worded well enough to be understood

I have an error "Access to this video has been restricted by its creator" on my video that I am the only one who can watch it and error "Access to this video has been restricted by the community's managers" which is available for donors.

Cookies are passed from browser and I tried pass them with a file exported via Get cookies.txt. But it's suspicious there is no an error like "Login failed" when cookies is not passed.

Here is my code:

 import yt_dlp, pathlib

def download_video (URL):
     path = pathlib.Path(r"C:\users\Иван\Documents\Python_programs\DownloadKV\vk.com.txt")

     ydl_opts = { "cookies-from-browser": "chrome", "verbose": True, "ie": "vk" }
     with yt_dlp.YoutubeDL (ydl_opts) as ydl:
          ydl.download (URL)

download_video("https://vk.com/video/subscriptions?z=video-168725999_456240334%2Fpl_cat_subscribes") 

Complete Verbose Output

[debug] Encodings: locale cp1251, fs utf-8, pref cp1251, out utf-8, error utf-8, screen utf-8 
[debug] yt-dlp version 2023.01.06 [6becd2508] API 
[debug] params: {'verbose': True, 'ie': 'vk', 'compat_opts': set()}
[debug] Lazy loading extractors is disabled
[debug] Python 3.11.1 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1q  5 Jul 2022) 
[debug] exe versions: none 
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1767 extractors 

What I have tried:

  1. The first that I tried is fix vk video extractor for youtube_dl and it helped but a week later the errors occured.
  2. last release of yt_dlp and with "Fix vk video extractor".
  3. yt_dlp_patched

I’d appreciate your help!

dirkf commented 1 year ago

Please discuss this in the yt-dlp tracker to avoid confusion.

kimryak commented 1 year ago

Please discuss this in the yt-dlp tracker to avoid confusion.

Yep, my mistake

dirkf commented 1 year ago

Back-port of the newly updated yt-dlp extractor handles https://vk.com/video-133441491_456261066.