Repository: yt-dlp/yt-dlp

Issue:
Support for fuyin.tv
### Checklist

- [X] I'm reporting a new site support request
- [X] I've verified that I'm running yt-dlp version **2022.02.04**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that none of provided URLs [violate any copyrights](https://github.com/ytdl-org/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge
- [X] I've searched 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)
- [ ] 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 am willing to share it if required

### Region

_No response_

### Example URLs

-https://fuyin.tv/content/view/movid/2733/
-https://fuyin.tv/html/2733/44129.html

### Description

The first link is to a playlist of sorts. The blue buttons access the videos while the green ones download.
The second link is to an individual video that was accessed from clicking the blue button, specifically from episode one of the playlist.
YT-dlp download url for the second link is 
https://vod-hls.sanmanuela.com/07%E7%A6%8F%E9%9F%B3%E5%8A%A8%E6%BC%AB/%E5%85%89%E7%85%A7%E4%B8%AD%E5%8D%8E/01%E6%88%B4%E5%BE%B7%E7%94%9F%E7%9A%84%E6%95%85%E4%BA%8B.mp4/index.m3u8?_upt=df9141561645695278

### Verbose log

```shell
yt-dlp "https://fuyin.tv/html/52/20518.html" -v
[debug] Command-line config: ['https://fuyin.tv/html/52/20518.html', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.02.04 [c1653e9ef]
[debug] Python version 3.9.0 (CPython 64bit) - macOS-12.2.1-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [generic] Extracting URL: https://fuyin.tv/html/52/20518.html
[generic] 20518: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] 20518: Downloading webpage
[generic] 20518: Extracting information
[debug] Looking for video embeds
ERROR: Unsupported URL: https://fuyin.tv/html/52/20518.html
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1381, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1451, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 612, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/extractor/generic.py", line 3986, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: https://fuyin.tv/html/52/20518.html
```



Discussion:
The movie links in the first page are inside this HTML pattern, but need to be resolved against the page URL:
```html
<td class="movie-list-title">
	<a title="..." href="target_url_path" ...>...</a>
```
Media links in the second page are in a `<script>` element below the player, like so:
```html
<video id="my-player" ...</video>
<script>
...
			var mp4url = "target_mp4_url";
			var m3u8url = "target_m3u8_url";
...
</script>
```


Resolving patch:
diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py
--- a/yt_dlp/extractor/_extractors.py
+++ b/yt_dlp/extractor/_extractors.py
@@ -563,6 +563,7 @@
 )
 from .funk import FunkIE
 from .fusion import FusionIE
+from .fuyintv import FuyinTVIE
 from .gab import (
     GabTVIE,
     GabIE,
diff --git a/yt_dlp/extractor/fuyintv.py b/yt_dlp/extractor/fuyintv.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/fuyintv.py
@@ -0,0 +1,30 @@
+from .common import InfoExtractor
+from ..utils import traverse_obj
+
+
+class FuyinTVIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?fuyin\.tv/html/(?:\d+)/(?P<id>\d+)\.html'
+    _TESTS = [{
+        'url': 'https://www.fuyin.tv/html/2733/44129.html',
+        'info_dict': {
+            'id': '44129',
+            'ext': 'mp4',
+            'title': '第1集',
+            'description': 'md5:21a3d238dc8d49608e1308e85044b9c3',
+        }
+    }]
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        json_data = self._download_json(
+            'https://www.fuyin.tv/api/api/tv.movie/url',
+            video_id, query={'urlid': f'{video_id}'})
+        webpage = self._download_webpage(url, video_id, fatal=False)
+
+        return {
+            'id': video_id,
+            'title': traverse_obj(json_data, ('data', 'title')),
+            'url': json_data['data']['url'],
+            'ext': 'mp4',
+            'description': self._html_search_meta('description', webpage),
+        }


Test patch: