Repository: ytdl-org/youtube-dl

Issue:
Motherless ERROR: Unable to extract uploader_id
## Checklist

- [x] I'm reporting a broken site support
- [x] I've verified that I'm running youtube-dl version **2021.06.06**
- [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 issues including closed ones


## Verbose log
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-f', 'best', '-ciw', '--verbose', 'https://motherless.com/0EBC4FA']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg git-2020-05-22-38490cb, ffprobe git-2020-05-22-38490cb
[debug] Proxy map: {}
[Motherless] 0EBC4FA: Downloading webpage
ERROR: Unable to extract uploader_id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 534, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\motherless.py", line 131, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 1021, in _html_search_regex
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 1012, in _search_regex
youtube_dl.utils.RegexNotFoundError: Unable to extract uploader_id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

## Description

I ran the command:
youtube-dl -f best -ciw --verbose "https://motherless.com/0EBC4FA"
And got the error as written above.


Discussion:
At lines 129ff. of `extractor/motherless.py`
```
        uploader_id = self._html_search_regex(
            r'"thumb-member-username">\s+<a href="/m/([^"]+)"',                 
            webpage, 'uploader_id')                                      
```
the final line should be
```
            webpage, 'uploader_id', fatal=False)
```
to prevent this, while still retrieving the requested video.

For an improved version, we could also look for the `uploader_id` in page fragment `<span class="username">...</span>` and get resolution from the `data-quality` attribute of the `<video>` tag. Possibly use the `_parse_html5_media_entries()` method.
> 
> ## Checklist
> 
>     * [x]  I'm reporting a broken site support
> 
>     * [x]  I've verified that I'm running youtube-dl version **2021.06.06**
> 
>     * [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 issues including closed ones
> 
> 
> ## Verbose log
> 
> [debug] System config: []
> [debug] User config: []
> [debug] Custom config: []
> [debug] Command-line args: ['-f', 'best', '-ciw', '--verbose', 'https://motherless.com/0EBC4FA']
> [debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
> [debug] youtube-dl version 2021.06.06
> [debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
> [debug] exe versions: ffmpeg git-2020-05-22-38490cb, ffprobe git-2020-05-22-38490cb
> [debug] Proxy map: {}
> [Motherless] 0EBC4FA: Downloading webpage
> ERROR: Unable to extract uploader_id; please report this issue on [yt-dl.org/bug](https://yt-dl.org/bug) . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
> Traceback (most recent call last):
> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 534, in extract
> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\motherless.py", line 131, in _real_extract
> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 1021, in _html_search_regex
> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 1012, in _search_regex
> youtube_dl.utils.RegexNotFoundError: Unable to extract uploader_id; please report this issue on [yt-dl.org/bug](https://yt-dl.org/bug) . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
> ## Description
> 
> I ran the command:
> youtube-dl -f best -ciw --verbose "[motherless.com/0EBC4FA](https://motherless.com/0EBC4FA)"
> And got the error as written above.

same
@dirkf `username` is a good idea.

This patch works for me

```
diff --git a/youtube_dl/extractor/motherless.py b/youtube_dl/extractor/motherless.py
index ef1e081f2..3e244caf1 100644
--- a/youtube_dl/extractor/motherless.py
+++ b/youtube_dl/extractor/motherless.py
@@ -127,7 +127,7 @@ class MotherlessIE(InfoExtractor):

         comment_count = webpage.count('class="media-comment-contents"')
         uploader_id = self._html_search_regex(
-            r'"thumb-member-username">\s+<a href="/m/([^"]+)"',
+            r'<span class=\"username\">([^"]+)<\/span>',
             webpage, 'uploader_id')

         categories = self._html_search_meta('keywords', webpage, default=None)
```

Resolving patch:
diff --git a/youtube_dl/extractor/motherless.py b/youtube_dl/extractor/motherless.py
--- a/youtube_dl/extractor/motherless.py
+++ b/youtube_dl/extractor/motherless.py
@@ -1,3 +1,4 @@
+# coding: utf-8
 from __future__ import unicode_literals
 
 import datetime
@@ -71,7 +72,7 @@ class MotherlessIE(InfoExtractor):
             'title': 'a/ Hot Teens',
             'categories': list,
             'upload_date': '20210104',
-            'uploader_id': 'yonbiw',
+            'uploader_id': 'anonymous',
             'thumbnail': r're:https?://.*\.jpg',
             'age_limit': 18,
         },
@@ -127,7 +128,7 @@ def _real_extract(self, url):
 
         comment_count = webpage.count('class="media-comment-contents"')
         uploader_id = self._html_search_regex(
-            r'"thumb-member-username">\s+<a href="/m/([^"]+)"',
+            r'''(?s)['"](?:media-meta-member|thumb-member-username)\b[^>]+>\s*<a\b[^>]+\bhref\s*=\s*['"]/m/([^"']+)''',
             webpage, 'uploader_id')
 
         categories = self._html_search_meta('keywords', webpage, default=None)
@@ -169,7 +170,7 @@ class MotherlessGroupIE(InfoExtractor):
             'description': 'Sex can be funny. Wide smiles,laugh, games, fun of '
                            'any kind!'
         },
-        'playlist_mincount': 9,
+        'playlist_mincount': 0,
     }]
 
     @classmethod
@@ -208,9 +209,9 @@ def _real_extract(self, url):
             r'<title>([\w\s]+\w)\s+-', webpage, 'title', fatal=False)
         description = self._html_search_meta(
             'description', webpage, fatal=False)
-        page_count = self._int(self._search_regex(
-            r'(\d+)</(?:a|span)><(?:a|span)[^>]+>\s*NEXT',
-            webpage, 'page_count'), 'page_count')
+        page_count = str_to_int(self._search_regex(
+            r'(\d+)\s*</(?:a|span)>\s*<(?:a|span)[^>]+(?:>\s*NEXT|\brel\s*=\s*["\']?next)\b',
+            webpage, 'page_count', default='1'))
         PAGE_SIZE = 80
 
         def _get_page(idx):


Test patch: