Repository: yt-dlp/yt-dlp

Issue:
This Old House Unable to Extract Video URL
### 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

Trying to pull stream of "This Old House" Season 45 Episode 17 as an Insider, paid subscriber, tried both --cookies and --username --password both produce same error: "Unable to extract video url; please report..."  
Can supply username and password to verify developer upon request.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] 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
[debug] Command-line config: ['-vU', '--username', 'PRIVATE', '--password', 'PRIVATE', 'https://www.thisoldhouse.com/glen-ridge-generational/99537/s45-e17-multi-generational', '-o', 'This Old House - S45E17.mp4']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447] (pip)
[debug] Python 3.10.5 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1n  15 Mar 2022)
[debug] exe versions: ffmpeg 6.1-full_build-www.gyan.dev (setts), ffprobe 6.1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.31.0, sqlite3-3.37.2, urllib3-2.0.7, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1803 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.03.10 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.03.10 from yt-dlp/yt-dlp)
[ThisOldHouse] Requesting session cookies
[ThisOldHouse] Requesting login info
[ThisOldHouse] Submitting credentials
[ThisOldHouse] Completing login
[ThisOldHouse] Extracting URL: https://www.thisoldhouse.com/glen-ridge-generational/99537/s45-e17-multi-generational
[ThisOldHouse] s45-e17-multi-generational: Downloading webpage
ERROR: [ThisOldHouse] s45-e17-multi-generational: Unable to extract video url; 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 "C:\Users\Jules\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\common.py", line 732, in extract
    ie_result = self._real_extract(url)
  File "C:\Users\Jules\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\thisoldhouse.py", line 99, in _real_extract
    video_url, video_id = self._search_regex(
  File "C:\Users\Jules\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\common.py", line 1280, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
```



Discussion:
I can look into it. Reach me at `bashonly (at) p rotonm ail (dot) com` or `bashonly` on discord to provide account credentials

Resolving patch:
diff --git a/yt_dlp/extractor/thisoldhouse.py b/yt_dlp/extractor/thisoldhouse.py
--- a/yt_dlp/extractor/thisoldhouse.py
+++ b/yt_dlp/extractor/thisoldhouse.py
@@ -1,5 +1,6 @@
 import json
 
+from .brightcove import BrightcoveNewIE
 from .common import InfoExtractor
 from .zype import ZypeIE
 from ..networking import HEADRequest
@@ -8,6 +9,7 @@
     ExtractorError,
     filter_dict,
     parse_qs,
+    smuggle_url,
     try_call,
     urlencode_postdata,
 )
@@ -17,23 +19,43 @@ class ThisOldHouseIE(InfoExtractor):
     _NETRC_MACHINE = 'thisoldhouse'
     _VALID_URL = r'https?://(?:www\.)?thisoldhouse\.com/(?:watch|how-to|tv-episode|(?:[^/?#]+/)?\d+)/(?P<id>[^/?#]+)'
     _TESTS = [{
+        # Unresolved Brightcove URL embed (formerly Zype), free
         'url': 'https://www.thisoldhouse.com/furniture/21017078/how-to-build-a-storage-bench',
         'info_dict': {
-            'id': '5dcdddf673c3f956ef5db202',
+            'id': '6325298523112',
             'ext': 'mp4',
             'title': 'How to Build a Storage Bench',
             'description': 'In the workshop, Tom Silva and Kevin O\'Connor build a storage bench for an entryway.',
-            'timestamp': 1442548800,
-            'upload_date': '20150918',
-            'duration': 674,
-            'view_count': int,
-            'average_rating': 0,
-            'thumbnail': r're:^https?://.*\.jpg\?\d+$',
-            'display_id': 'how-to-build-a-storage-bench',
+            'timestamp': 1681793639,
+            'upload_date': '20230418',
+            'duration': 674.54,
+            'tags': 'count:11',
+            'uploader_id': '6314471934001',
+            'thumbnail': r're:^https?://.*\.jpg',
         },
         'params': {
             'skip_download': True,
         },
+    }, {
+        # Brightcove embed, authwalled
+        'url': 'https://www.thisoldhouse.com/glen-ridge-generational/99537/s45-e17-multi-generational',
+        'info_dict': {
+            'id': '6349675446112',
+            'ext': 'mp4',
+            'title': 'E17 | Glen Ridge Generational | Multi-Generational',
+            'description': 'md5:53c6bc2e8031f3033d693d9a3563222c',
+            'timestamp': 1711382202,
+            'upload_date': '20240325',
+            'duration': 1422.229,
+            'tags': 'count:13',
+            'uploader_id': '6314471934001',
+            'thumbnail': r're:^https?://.*\.jpg',
+        },
+        'expected_warnings': ['Login with password is not supported for this website'],
+        'params': {
+            'skip_download': True,
+        },
+        'skip': 'Requires subscription',
     }, {
         # Page no longer has video
         'url': 'https://www.thisoldhouse.com/watch/arlington-arts-crafts-arts-and-crafts-class-begins',
@@ -98,7 +120,15 @@ def _real_extract(self, url):
 
         video_url, video_id = self._search_regex(
             r'<iframe[^>]+src=[\'"]((?:https?:)?//(?:www\.)?thisoldhouse\.(?:chorus\.build|com)/videos/zype/([0-9a-f]{24})[^\'"]*)[\'"]',
-            webpage, 'video url', group=(1, 2))
-        video_url = self._request_webpage(HEADRequest(video_url), video_id, 'Resolving Zype URL').url
+            webpage, 'zype url', group=(1, 2), default=(None, None))
+        if video_url:
+            video_url = self._request_webpage(HEADRequest(video_url), video_id, 'Resolving Zype URL').url
+            return self.url_result(video_url, ZypeIE, video_id)
 
-        return self.url_result(video_url, ZypeIE, video_id)
+        video_url, video_id = self._search_regex([
+            r'<iframe[^>]+src=[\'"]((?:https?:)?//players\.brightcove\.net/\d+/\w+/index\.html\?videoId=(\d+))',
+            r'<iframe[^>]+src=[\'"]((?:https?:)?//(?:www\.)thisoldhouse\.com/videos/brightcove/(\d+))'],
+            webpage, 'iframe url', group=(1, 2))
+        if not parse_qs(video_url).get('videoId'):
+            video_url = self._request_webpage(HEADRequest(video_url), video_id, 'Resolving Brightcove URL').url
+        return self.url_result(smuggle_url(video_url, {'referrer': url}), BrightcoveNewIE, video_id)


Test patch: