We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Craftsy Extractor Failure
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

USA

### Provide a description that is worded well enough to be understood

Attempting to use Craftsy extractor (on this link: https://www.craftsy.com/class/complete-knife-skills), I get "Unable to extract video data". I don't b

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
$ yt-dlp -vU --cookies cookies.txt "https://www.craftsy.com/class/complete-knife-skills"
[debug] Command-line config: ['-vU', '--cookies', 'cookies.txt', 'https://www.craftsy.com/class/complete-knife-skills']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.12.30 from yt-dlp/yt-dlp [f10589e34] (pip)
[debug] Python 3.12.2 (CPython x86_64 64bit) - macOS-14.3.1-x86_64-i386-64bit (OpenSSL 3.2.1 30 Jan 2024)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.1, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1798 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2023.12.30 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2023.12.30 from yt-dlp/yt-dlp)
[Craftsy] Extracting URL: https://www.craftsy.com/class/complete-knife-skills
[Craftsy] complete-knife-skills: Downloading webpage
ERROR: [Craftsy] complete-knife-skills: Unable to extract video data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/usr/local/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py", line 718, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/craftsy.py", line 44, in _real_extract
    video_data = self._parse_json(self._search_regex(
                                  ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py", line 1266, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `yt_dlp/extractor/craftsy.py`
Content:
```
1 from .brightcove import BrightcoveNewIE
2 from .common import InfoExtractor
3 
4 from ..utils import (
5     dict_get,
6     get_element_by_id,
7     js_to_json,
8     traverse_obj,
9 )
10 
11 
12 class CraftsyIE(InfoExtractor):
13     _VALID_URL = r'https?://www\.craftsy\.com/class/(?P<id>[\w-]+)'
14     _TESTS = [{
15         'url': 'https://www.craftsy.com/class/the-midnight-quilt-show-season-5/',
16         'info_dict': {
17             'id': 'the-midnight-quilt-show-season-5',
18             'title': 'The Midnight Quilt Show Season 5',
19             'description': 'md5:113eda818e985d1a566625fb2f833b7a',
20         },
21         'playlist_count': 10,
22     }, {
23         'url': 'https://www.craftsy.com/class/sew-your-own-designer-handbag/',
24         'info_dict': {
25             'id': 'sew-your-own-designer-handbag',
26             'title': 'Sew Your Own Designer Handbag',
27             'description': 'md5:8270d0ef5427d3c895a27351aeaac276',
28         },
29         'playlist_mincount': 1,
30     }, {
31         'url': 'https://www.craftsy.com/class/all-access-estes-park-wool-market/',
32         'info_dict': {
33             'id': 'all-access-estes-park-wool-market',
34             'title': 'All Access: Estes Park Wool Market',
35             'description': 'md5:aded1bd8d38ae2fae4dae936c0ae01e7',
36         },
37         'playlist_count': 6,
38     }]
39 
40     def _real_extract(self, url):
41         video_id = self._match_id(url)
42         webpage = self._download_webpage(url, video_id)
43 
44         video_data = self._parse_json(self._search_regex(
45             r'class_video_player_vars\s*=\s*({.*})\s*;',
46             get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage),
47             'video data'), video_id, transform_source=js_to_json)
48 
49         account_id = traverse_obj(video_data, ('video_player', 'bc_account_id'))
50 
51         entries = []
52         class_preview = traverse_obj(video_data, ('video_player', 'class_preview'))
53         if class_preview:
54             v_id = class_preview.get('video_id')
55             entries.append(self.url_result(
56                 f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={v_id}',
57                 BrightcoveNewIE, v_id, class_preview.get('title')))
58 
59         if dict_get(video_data, ('is_free', 'user_has_access')):
60             entries += [
61                 self.url_result(
62                     f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={lesson["video_id"]}',
63                     BrightcoveNewIE, lesson['video_id'], lesson.get('title'))
64                 for lesson in video_data['lessons']]
65 
66         return self.playlist_result(
67             entries, video_id, video_data.get('class_title'),
68             self._html_search_meta(('og:description', 'description'), webpage, default=None))
69
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/yt_dlp/extractor/craftsy.py b/yt_dlp/extractor/craftsy.py
--- a/yt_dlp/extractor/craftsy.py
+++ b/yt_dlp/extractor/craftsy.py
@@ -1,12 +1,13 @@
+import json
+
 from .brightcove import BrightcoveNewIE
 from .common import InfoExtractor
-
 from ..utils import (
-    dict_get,
-    get_element_by_id,
-    js_to_json,
-    traverse_obj,
+    extract_attributes,
+    get_element_html_by_class,
+    get_element_text_and_html_by_tag,
 )
+from ..utils.traversal import traverse_obj
 
 
 class CraftsyIE(InfoExtractor):
@@ -41,28 +42,34 @@
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
-        video_data = self._parse_json(self._search_regex(
-            r'class_video_player_vars\s*=\s*({.*})\s*;',
-            get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage),
-            'video data'), video_id, transform_source=js_to_json)
+        video_player = get_element_html_by_class('class-video-player', webpage)
+        video_data = traverse_obj(video_player, (
+            {extract_attributes}, 'wire:snapshot', {json.loads}, 'data', {dict})) or {}
+        video_js = traverse_obj(video_player, (
+            {lambda x: get_element_text_and_html_by_tag('video-js', x)}, 1, {extract_attributes})) or {}
+
+        has_access = video_data.get('userHasAccess')
+        lessons = traverse_obj(video_data, ('lessons', ..., ..., lambda _, v: v['video_id']))
+
+        preview_id = video_js.get('data-video-id')
+        if preview_id and preview_id not in traverse_obj(lessons, (..., 'video_id')):
+            if not lessons and not has_access:
+                self.report_warning(
+                    'Only extracting preview. For the full class, pass cookies '
+                    + f'from an account that has access. {self._login_hint()}')
+            lessons.append({'video_id': preview_id})
 
-        account_id = traverse_obj(video_data, ('video_player', 'bc_account_id'))
+        if not lessons and not has_access:
+            self.raise_login_required('You do not have access to this class')
 
-        entries = []
-        class_preview = traverse_obj(video_data, ('video_player', 'class_preview'))
-        if class_preview:
-            v_id = class_preview.get('video_id')
-            entries.append(self.url_result(
-                f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={v_id}',
-                BrightcoveNewIE, v_id, class_preview.get('title')))
+        account_id = video_data.get('accountId') or video_js['data-account']
 
-        if dict_get(video_data, ('is_free', 'user_has_access')):
-            entries += [
-                self.url_result(
+        def entries(lessons):
+            for lesson in lessons:
+                yield self.url_result(
                     f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={lesson["video_id"]}',
                     BrightcoveNewIE, lesson['video_id'], lesson.get('title'))
-                for lesson in video_data['lessons']]
 
         return self.playlist_result(
-            entries, video_id, video_data.get('class_title'),
+            entries(lessons), video_id, self._html_search_meta(('og:title', 'twitter:title'), webpage),
             self._html_search_meta(('og:description', 'description'), webpage, default=None))

{"golden_diff": "diff --git a/yt_dlp/extractor/craftsy.py b/yt_dlp/extractor/craftsy.py\n--- a/yt_dlp/extractor/craftsy.py\n+++ b/yt_dlp/extractor/craftsy.py\n@@ -1,12 +1,13 @@\n+import json\n+\n from .brightcove import BrightcoveNewIE\n from .common import InfoExtractor\n-\n from ..utils import (\n-    dict_get,\n-    get_element_by_id,\n-    js_to_json,\n-    traverse_obj,\n+    extract_attributes,\n+    get_element_html_by_class,\n+    get_element_text_and_html_by_tag,\n )\n+from ..utils.traversal import traverse_obj\n \n \n class CraftsyIE(InfoExtractor):\n@@ -41,28 +42,34 @@\n         video_id = self._match_id(url)\n         webpage = self._download_webpage(url, video_id)\n \n-        video_data = self._parse_json(self._search_regex(\n-            r'class_video_player_vars\\s*=\\s*({.*})\\s*;',\n-            get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage),\n-            'video data'), video_id, transform_source=js_to_json)\n+        video_player = get_element_html_by_class('class-video-player', webpage)\n+        video_data = traverse_obj(video_player, (\n+            {extract_attributes}, 'wire:snapshot', {json.loads}, 'data', {dict})) or {}\n+        video_js = traverse_obj(video_player, (\n+            {lambda x: get_element_text_and_html_by_tag('video-js', x)}, 1, {extract_attributes})) or {}\n+\n+        has_access = video_data.get('userHasAccess')\n+        lessons = traverse_obj(video_data, ('lessons', ..., ..., lambda _, v: v['video_id']))\n+\n+        preview_id = video_js.get('data-video-id')\n+        if preview_id and preview_id not in traverse_obj(lessons, (..., 'video_id')):\n+            if not lessons and not has_access:\n+                self.report_warning(\n+                    'Only extracting preview. For the full class, pass cookies '\n+                    + f'from an account that has access. {self._login_hint()}')\n+            lessons.append({'video_id': preview_id})\n \n-        account_id = traverse_obj(video_data, ('video_player', 'bc_account_id'))\n+        if not lessons and not has_access:\n+            self.raise_login_required('You do not have access to this class')\n \n-        entries = []\n-        class_preview = traverse_obj(video_data, ('video_player', 'class_preview'))\n-        if class_preview:\n-            v_id = class_preview.get('video_id')\n-            entries.append(self.url_result(\n-                f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={v_id}',\n-                BrightcoveNewIE, v_id, class_preview.get('title')))\n+        account_id = video_data.get('accountId') or video_js['data-account']\n \n-        if dict_get(video_data, ('is_free', 'user_has_access')):\n-            entries += [\n-                self.url_result(\n+        def entries(lessons):\n+            for lesson in lessons:\n+                yield self.url_result(\n                     f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={lesson[\"video_id\"]}',\n                     BrightcoveNewIE, lesson['video_id'], lesson.get('title'))\n-                for lesson in video_data['lessons']]\n \n         return self.playlist_result(\n-            entries, video_id, video_data.get('class_title'),\n+            entries(lessons), video_id, self._html_search_meta(('og:title', 'twitter:title'), webpage),\n             self._html_search_meta(('og:description', 'description'), webpage, default=None))\n", "issue": "Craftsy Extractor Failure\n### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE\n\n- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\\* field\n\n### Checklist\n\n- [X] I'm reporting that yt-dlp is broken on a **supported** site\n- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))\n- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details\n- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)\n- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates\n- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)\n- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required\n\n### Region\n\nUSA\n\n### Provide a description that is worded well enough to be understood\n\nAttempting to use Craftsy extractor (on this link: https://www.craftsy.com/class/complete-knife-skills), I get \"Unable to extract video data\". I don't b\n\n### Provide verbose output that clearly demonstrates the problem\n\n- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)\n- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead\n- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below\n\n### Complete Verbose Output\n\n```shell\n$ yt-dlp -vU --cookies cookies.txt \"https://www.craftsy.com/class/complete-knife-skills\"\r\n[debug] Command-line config: ['-vU', '--cookies', 'cookies.txt', 'https://www.craftsy.com/class/complete-knife-skills']\r\n[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8\r\n[debug] yt-dlp version stable@2023.12.30 from yt-dlp/yt-dlp [f10589e34] (pip)\r\n[debug] Python 3.12.2 (CPython x86_64 64bit) - macOS-14.3.1-x86_64-i386-64bit (OpenSSL 3.2.1 30 Jan 2024)\r\n[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1\r\n[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.1, urllib3-2.2.1, websockets-12.0\r\n[debug] Proxy map: {}\r\n[debug] Request Handlers: urllib, requests, websockets\r\n[debug] Loaded 1798 extractors\r\n[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest\r\nLatest version: stable@2023.12.30 from yt-dlp/yt-dlp\r\nyt-dlp is up to date (stable@2023.12.30 from yt-dlp/yt-dlp)\r\n[Craftsy] Extracting URL: https://www.craftsy.com/class/complete-knife-skills\r\n[Craftsy] complete-knife-skills: Downloading webpage\r\nERROR: [Craftsy] complete-knife-skills: Unable to extract video data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U\r\n  File \"/usr/local/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py\", line 718, in extract\r\n    ie_result = self._real_extract(url)\r\n                ^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/usr/local/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/craftsy.py\", line 44, in _real_extract\r\n    video_data = self._parse_json(self._search_regex(\r\n                                  ^^^^^^^^^^^^^^^^^^^\r\n  File \"/usr/local/Cellar/yt-dlp/2023.12.30/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py\", line 1266, in _search_regex\r\n    raise RegexNotFoundError('Unable to extract %s' % _name)\n```\n\n", "before_files": [{"content": "from .brightcove import BrightcoveNewIE\nfrom .common import InfoExtractor\n\nfrom ..utils import (\n    dict_get,\n    get_element_by_id,\n    js_to_json,\n    traverse_obj,\n)\n\n\nclass CraftsyIE(InfoExtractor):\n    _VALID_URL = r'https?://www\\.craftsy\\.com/class/(?P<id>[\\w-]+)'\n    _TESTS = [{\n        'url': 'https://www.craftsy.com/class/the-midnight-quilt-show-season-5/',\n        'info_dict': {\n            'id': 'the-midnight-quilt-show-season-5',\n            'title': 'The Midnight Quilt Show Season 5',\n            'description': 'md5:113eda818e985d1a566625fb2f833b7a',\n        },\n        'playlist_count': 10,\n    }, {\n        'url': 'https://www.craftsy.com/class/sew-your-own-designer-handbag/',\n        'info_dict': {\n            'id': 'sew-your-own-designer-handbag',\n            'title': 'Sew Your Own Designer Handbag',\n            'description': 'md5:8270d0ef5427d3c895a27351aeaac276',\n        },\n        'playlist_mincount': 1,\n    }, {\n        'url': 'https://www.craftsy.com/class/all-access-estes-park-wool-market/',\n        'info_dict': {\n            'id': 'all-access-estes-park-wool-market',\n            'title': 'All Access: Estes Park Wool Market',\n            'description': 'md5:aded1bd8d38ae2fae4dae936c0ae01e7',\n        },\n        'playlist_count': 6,\n    }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        webpage = self._download_webpage(url, video_id)\n\n        video_data = self._parse_json(self._search_regex(\n            r'class_video_player_vars\\s*=\\s*({.*})\\s*;',\n            get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage),\n            'video data'), video_id, transform_source=js_to_json)\n\n        account_id = traverse_obj(video_data, ('video_player', 'bc_account_id'))\n\n        entries = []\n        class_preview = traverse_obj(video_data, ('video_player', 'class_preview'))\n        if class_preview:\n            v_id = class_preview.get('video_id')\n            entries.append(self.url_result(\n                f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={v_id}',\n                BrightcoveNewIE, v_id, class_preview.get('title')))\n\n        if dict_get(video_data, ('is_free', 'user_has_access')):\n            entries += [\n                self.url_result(\n                    f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={lesson[\"video_id\"]}',\n                    BrightcoveNewIE, lesson['video_id'], lesson.get('title'))\n                for lesson in video_data['lessons']]\n\n        return self.playlist_result(\n            entries, video_id, video_data.get('class_title'),\n            self._html_search_meta(('og:description', 'description'), webpage, default=None))\n", "path": "yt_dlp/extractor/craftsy.py"}], "after_files": [{"content": "import json\n\nfrom .brightcove import BrightcoveNewIE\nfrom .common import InfoExtractor\nfrom ..utils import (\n    extract_attributes,\n    get_element_html_by_class,\n    get_element_text_and_html_by_tag,\n)\nfrom ..utils.traversal import traverse_obj\n\n\nclass CraftsyIE(InfoExtractor):\n    _VALID_URL = r'https?://www\\.craftsy\\.com/class/(?P<id>[\\w-]+)'\n    _TESTS = [{\n        'url': 'https://www.craftsy.com/class/the-midnight-quilt-show-season-5/',\n        'info_dict': {\n            'id': 'the-midnight-quilt-show-season-5',\n            'title': 'The Midnight Quilt Show Season 5',\n            'description': 'md5:113eda818e985d1a566625fb2f833b7a',\n        },\n        'playlist_count': 10,\n    }, {\n        'url': 'https://www.craftsy.com/class/sew-your-own-designer-handbag/',\n        'info_dict': {\n            'id': 'sew-your-own-designer-handbag',\n            'title': 'Sew Your Own Designer Handbag',\n            'description': 'md5:8270d0ef5427d3c895a27351aeaac276',\n        },\n        'playlist_mincount': 1,\n    }, {\n        'url': 'https://www.craftsy.com/class/all-access-estes-park-wool-market/',\n        'info_dict': {\n            'id': 'all-access-estes-park-wool-market',\n            'title': 'All Access: Estes Park Wool Market',\n            'description': 'md5:aded1bd8d38ae2fae4dae936c0ae01e7',\n        },\n        'playlist_count': 6,\n    }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        webpage = self._download_webpage(url, video_id)\n\n        video_player = get_element_html_by_class('class-video-player', webpage)\n        video_data = traverse_obj(video_player, (\n            {extract_attributes}, 'wire:snapshot', {json.loads}, 'data', {dict})) or {}\n        video_js = traverse_obj(video_player, (\n            {lambda x: get_element_text_and_html_by_tag('video-js', x)}, 1, {extract_attributes})) or {}\n\n        has_access = video_data.get('userHasAccess')\n        lessons = traverse_obj(video_data, ('lessons', ..., ..., lambda _, v: v['video_id']))\n\n        preview_id = video_js.get('data-video-id')\n        if preview_id and preview_id not in traverse_obj(lessons, (..., 'video_id')):\n            if not lessons and not has_access:\n                self.report_warning(\n                    'Only extracting preview. For the full class, pass cookies '\n                    + f'from an account that has access. {self._login_hint()}')\n            lessons.append({'video_id': preview_id})\n\n        if not lessons and not has_access:\n            self.raise_login_required('You do not have access to this class')\n\n        account_id = video_data.get('accountId') or video_js['data-account']\n\n        def entries(lessons):\n            for lesson in lessons:\n                yield self.url_result(\n                    f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={lesson[\"video_id\"]}',\n                    BrightcoveNewIE, lesson['video_id'], lesson.get('title'))\n\n        return self.playlist_result(\n            entries(lessons), video_id, self._html_search_meta(('og:title', 'twitter:title'), webpage),\n            self._html_search_meta(('og:description', 'description'), webpage, default=None))\n", "path": "yt_dlp/extractor/craftsy.py"}]}