diff --git a/README_PYPI.md b/README_PYPI.md deleted file mode 100644 index 36614ad..0000000 --- a/README_PYPI.md +++ /dev/null @@ -1,140 +0,0 @@ -# StreamGet - -`StreamGet` is a lightweight Python package designed to extract live stream URLs from live room links. - ------- - -## Features - -- **Extract Live Stream URLs**: Get direct video stream URLs by crawling the live room page and extracting the stream source interface. -- **Platform Support**: Works with popular live streaming platforms (e.g. Twitch, YouTube, Douyin, Xiaohongshu, Huya, Douyu, etc.). -- **No Dependencies**: Pure Python implementation with no external dependencies, ensuring lightweight and fast performance. - ------- - -## Installation - -Install `StreamGet` via pip: - -```bash -pip install streamget -``` - ------- - -## Quick Start - -```python -import asyncio -from streamget import spider, stream - - -async def main(): - # Initialize with a live room URL - url = "https://live.douyin.com/745964462470" - - # Get the live stream URL asynchronously - room_data = await spider.get_douyin_app_stream_data(url) - print('room_data:', room_data) - - stream_data = await stream.get_douyin_stream_url(room_data, '0') - print('stream_data :', stream_data) - stream_url = stream_data.get('record_url') - print("Live Stream URL:", stream_url) - - -# Run the async function -asyncio.run(main()) - -``` - ------- - -## Supported Platforms - -| Platform | Support status | HLS support | FLV support | -| :---------- | :------------- | :---------- | :---------- | -| 抖音 | ✅ | ✅ | ✅ | -| TikTok | ✅ | ✅ | ✅ | -| 快手 | ✅ | ❌ | ✅ | -| 虎牙 | ✅ | ✅ | ✅ | -| 斗鱼 | ✅ | ❌ | ✅ | -| YY | ✅ | ❌ | ✅ | -| B站 | ✅ | ❌ | ✅ | -| 小红书 | ✅ | ✅ | ✅ | -| Bigo | ✅ | ✅ | ❌ | -| Blued | ✅ | ✅ | ❌ | -| SOOP | ✅ | ✅ | ❌ | -| 网易CC | ✅ | ✅ | ✅ | -| 千度热播 | ✅ | ❌ | ✅ | -| PandaTV | ✅ | ✅ | ❌ | -| 猫耳FM | ✅ | ✅ | ✅ | -| Look直播 | ✅ | ✅ | ✅ | -| WinkTV | ✅ | ✅ | ❌ | -| FlexTV | ✅ | ✅ | ❌ | -| PopkonTV | ✅ | ✅ | ❌ | -| TwitCasting | ✅ | ✅ | ❌ | -| 百度直播 | ✅ | ✅ | ✅ | -| 微博直播 | ✅ | ✅ | ✅ | -| 酷狗直播 | ✅ | ❌ | ✅ | -| TwitchTV | ✅ | ✅ | ❌ | -| LiveMe | ✅ | ✅ | ✅ | -| 花椒直播 | ✅ | ❌ | ✅ | -| 流星直播 | ✅ | ❌ | ✅ | -| ShowRoom | ✅ | ✅ | ❌ | -| Acfun | ✅ | ✅ | ✅ | -| 映客直播 | ✅ | ✅ | ✅ | -| 音播直播 | ✅ | ✅ | ✅ | -| 知乎直播 | ✅ | ✅ | ✅ | -| CHZZK | ✅ | ✅ | ❌ | -| 嗨秀直播 | ✅ | ❌ | ✅ | -| vv星球直播 | ✅ | ✅ | ❌ | -| 17Live | ✅ | ❌ | ✅ | -| 浪Live | ✅ | ✅ | ✅ | -| 畅聊直播 | ✅ | ✅ | ✅ | -| 飘飘直播 | ✅ | ✅ | ✅ | -| 六间房直播 | ✅ | ❌ | ✅ | -| 乐嗨直播 | ✅ | ✅ | ✅ | -| 花猫直播 | ✅ | ✅ | ❌ | -| Shopee | ✅ | ❌ | ✅ | -| YouTube | ✅ | ✅ | ❌ | -| 淘宝 | ✅ | ✅ | ✅ | -| 京东 | ✅ | ✅ | ✅ | -| Faceit | ✅ | ✅ | ❌ | -| More ... | | | | - -### Notes: - -1. **Support Status**: ✅ indicates supported, ❌ indicates unsupported. - ------- - -## Supported Quality - -| Chinese clarity | abbreviation | Full Name | Note | -| :-------------- | :----------- | :-------------------- | :------------------------------------------------- | -| 原画 | `OD` | Original Definition | Highest clarity, original picture quality | -| 蓝光 | `BD` | Blue-ray Definition | High definition close to blue light quality | -| 超清 | `UHD` | Ultra High Definition | Ultra high definition | -| 高清 | `HD` | High Definition | High definition, usually referring to 1080p | -| 标清 | `SD` | Standard Definition | Standard clarity, usually referring to 480p | -| 流畅 | `LD` | Low Definition | Low definition, usually referring to 360p or lower | - -## Contributing - -Contributions are welcome! If you'd like to add support for a new platform or improve the package, please check out the [GitHub repository](https://github.com/ihmily/DouyinLiveRecorder) and submit a pull request. - ------- - -## License - -`StreamGet` is released under the MIT License. See the [LICENSE](https://github.com/ihmily/DouyinLiveRecorder/blob/main/LICENSE) file for details. - ------- - -## Documentation - -For full documentation and advanced usage, visit the [official documentation](https://streamget.readthedocs.io/). - ------- - diff --git a/demo.py b/demo.py index d3b9f4c..47fd5e2 100644 --- a/demo.py +++ b/demo.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import asyncio -from streamget.logger import logger -from streamget import spider +from src.logger import logger +from src import spider # 以下示例直播间链接不保证时效性,请自行查看链接是否能正常访问 # Please note that the following example live room links may not be up-to-date diff --git a/ffmpeg_install.py b/ffmpeg_install.py index 29a319e..d0f32a6 100644 --- a/ffmpeg_install.py +++ b/ffmpeg_install.py @@ -15,7 +15,7 @@ import zipfile from pathlib import Path import requests from tqdm import tqdm -from streamget.logger import logger +from src.logger import logger current_platform = platform.system() execute_dir = os.path.split(os.path.realpath(sys.argv[0]))[0] @@ -218,4 +218,4 @@ def check_ffmpeg_installed() -> bool: def check_ffmpeg() -> bool: if not check_ffmpeg_installed(): return install_ffmpeg() - return True \ No newline at end of file + return True diff --git a/i18n.py b/i18n.py index 36fb281..c90ff4d 100644 --- a/i18n.py +++ b/i18n.py @@ -20,7 +20,7 @@ else: locale_path = Path(execute_dir) / 'i18n' _tr = init_gettext(locale_path, 'zh_CN') original_print = builtins.print -package_name = 'streamget' +package_name = 'src' def translated_print(*args, **kwargs): diff --git a/main.py b/main.py index 016a697..89b25e8 100644 --- a/main.py +++ b/main.py @@ -27,10 +27,10 @@ import urllib.request from urllib.error import URLError, HTTPError from typing import Any import configparser -from streamget import spider, stream -from streamget.proxy import ProxyDetector -from streamget.utils import logger -from streamget import utils +from src import spider, stream +from src.proxy import ProxyDetector +from src.utils import logger +from src import utils from msg_push import ( dingtalk, xizhi, tg_bot, send_email, bark, ntfy ) diff --git a/poetry.toml b/poetry.toml deleted file mode 100644 index 9a48dd8..0000000 --- a/poetry.toml +++ /dev/null @@ -1,4 +0,0 @@ -[virtualenvs] -in-project = true -create = true -prefer-active-python = true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 799860b..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,24 +0,0 @@ -[project] -name = "streamget" -version = "4.0.3" -description = "A simple and efficient tool to fetch live stream URLs from various platforms. Supports multiple platforms and easy integration." -authors = [{ name = "Hmily" }] -license = {text = "MIT"} -readme = "README_PYPI.md" -urls = {Repository = "https://github.com/ihmily/DouyinLiveRecorder"} -keywords = ["douyin", "youtube", "tiktok", "twitch", "live", "recorder"] -requires-python = ">=3.10,<4.0" - -dependencies = [ - "requests>=2.31.0", - "loguru>=0.7.3", - "pycryptodome>=3.20.0", - "distro>=1.9.0", - "tqdm>=4.67.1", - "httpx[http2]>=0.28.1", - "PyExecJS>=1.5.1" -] - -[build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index c6f1821..0000000 --- a/setup.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -from setuptools import setup, find_packages - -setup( - name='streamget', - version='4.0.3', - author='Hmily', - description='A simple and efficient tool to fetch live stream URLs from various platforms. Supports multiple ' - 'platforms and easy integration.', - long_description=open('README_PYPI.md', encoding='utf-8').read(), - long_description_content_type='text/markdown', - url='https://github.com/ihmily/DouyinLiveRecorder', - packages=find_packages(), - install_requires=[ - 'requests>=2.31.0', - 'loguru>=0.7.3', - 'pycryptodome>=3.20.0', - 'distro>=1.9.0', - 'tqdm>=4.67.1', - 'httpx[http2]>=0.28.1' - 'PyExecJS>=1.5.1', - ], - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - ] -) diff --git a/streamget/__init__.py b/src/__init__.py similarity index 100% rename from streamget/__init__.py rename to src/__init__.py diff --git a/streamget/http_clients/__init__.py b/src/http_clients/__init__.py similarity index 100% rename from streamget/http_clients/__init__.py rename to src/http_clients/__init__.py diff --git a/streamget/http_clients/async_http.py b/src/http_clients/async_http.py similarity index 96% rename from streamget/http_clients/async_http.py rename to src/http_clients/async_http.py index 92fb1c6..2902373 100644 --- a/streamget/http_clients/async_http.py +++ b/src/http_clients/async_http.py @@ -37,7 +37,7 @@ async def async_req( return str(response.url) elif return_cookies: cookies_dict = {name: value for name, value in response.cookies.items()} - return response.text, cookies_dict if include_cookies else cookies_dict + return (response.text, cookies_dict) if include_cookies else cookies_dict else: resp_str = response.text except Exception as e: diff --git a/streamget/http_clients/sync_http.py b/src/http_clients/sync_http.py similarity index 100% rename from streamget/http_clients/sync_http.py rename to src/http_clients/sync_http.py diff --git a/streamget/initializer.py b/src/initializer.py similarity index 100% rename from streamget/initializer.py rename to src/initializer.py diff --git a/streamget/javascript/crypto-js.min.js b/src/javascript/crypto-js.min.js similarity index 100% rename from streamget/javascript/crypto-js.min.js rename to src/javascript/crypto-js.min.js diff --git a/streamget/javascript/haixiu.js b/src/javascript/haixiu.js similarity index 100% rename from streamget/javascript/haixiu.js rename to src/javascript/haixiu.js diff --git a/streamget/javascript/liveme.js b/src/javascript/liveme.js similarity index 100% rename from streamget/javascript/liveme.js rename to src/javascript/liveme.js diff --git a/streamget/javascript/taobao-sign.js b/src/javascript/taobao-sign.js similarity index 100% rename from streamget/javascript/taobao-sign.js rename to src/javascript/taobao-sign.js diff --git a/streamget/javascript/x-bogus.js b/src/javascript/x-bogus.js similarity index 100% rename from streamget/javascript/x-bogus.js rename to src/javascript/x-bogus.js diff --git a/streamget/logger.py b/src/logger.py similarity index 100% rename from streamget/logger.py rename to src/logger.py diff --git a/streamget/proxy.py b/src/proxy.py similarity index 100% rename from streamget/proxy.py rename to src/proxy.py diff --git a/streamget/room.py b/src/room.py similarity index 100% rename from streamget/room.py rename to src/room.py diff --git a/streamget/spider.py b/src/spider.py similarity index 100% rename from streamget/spider.py rename to src/spider.py diff --git a/streamget/stream.py b/src/stream.py similarity index 100% rename from streamget/stream.py rename to src/stream.py diff --git a/streamget/utils.py b/src/utils.py similarity index 100% rename from streamget/utils.py rename to src/utils.py