diff --git a/.github/workflows/release_auto.yml b/.github/workflows/release_auto.yml index 2f9967b..e6a5b32 100644 --- a/.github/workflows/release_auto.yml +++ b/.github/workflows/release_auto.yml @@ -10,6 +10,9 @@ on: jobs: release: runs-on: ubuntu-latest + permissions: + id-token: write + contents: write if: startsWith(github.event.head_commit.message, 'v') steps: - uses: actions/checkout@v4 @@ -40,5 +43,5 @@ jobs: - name: Release PYPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_JMCOMIC }} +# with: +# password: ${{ secrets.PYPI_JMCOMIC }} diff --git a/README.md b/README.md index bba6ac4..07afce1 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ jmcomic 123 ## 使用小说明 -* Python >= 3.7 +* Python >= 3.7,建议3.9以上,因为jmcomic的依赖库可能会不支持3.9以下的版本。 * 个人项目,文档和示例会有不及时之处,可以Issue提问 ## 项目文件夹介绍 diff --git a/assets/docs/sources/tutorial/0_common_usage.md b/assets/docs/sources/tutorial/0_common_usage.md index 7ca8472..69c647b 100644 --- a/assets/docs/sources/tutorial/0_common_usage.md +++ b/assets/docs/sources/tutorial/0_common_usage.md @@ -126,6 +126,8 @@ client = JmOption.default().new_jm_client() # 分页查询,search_site就是禁漫网页上的【站内搜索】 page: JmSearchPage = client.search_site(search_query='+MANA +无修正', page=1) +print(f'结果总数: {page.total}, 分页大小: {page.page_size},页数: {page.page_count}') + # page默认的迭代方式是page.iter_id_title(),每次迭代返回 albun_id, title for album_id, title in page: print(f'[{album_id}]: {title}') @@ -168,10 +170,10 @@ from jmcomic import * option = JmOption.default() client = option.new_jm_client() -client.login('用户名', '密码') # 也可以使用login插件/配置cookies +client.login('用户名', '密码') # 也可以使用login插件/配置cookies # 遍历全部收藏的所有页 -for page in cl.favorite_folder_gen(): # 如果你只想获取特定收藏夹,需要添加folder_id参数 +for page in client.favorite_folder_gen(): # 如果你只想获取特定收藏夹,需要添加folder_id参数 # 遍历每页结果 for aid, atitle in page.iter_id_title(): # aid: 本子的album_id @@ -183,9 +185,9 @@ for page in cl.favorite_folder_gen(): # 如果你只想获取特定收藏夹, # 获取特定收藏夹的单页,使用favorite_folder方法 page = client.favorite_folder(page=1, - order_by=JmMagicConstants.ORDER_BY_LATEST, - folder_id='0' # 收藏夹id - ) + order_by=JmMagicConstants.ORDER_BY_LATEST, + folder_id='0' # 收藏夹id + ) ``` ## 分类 / 排行榜 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bd564b6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,44 @@ +[build-system] +requires = ["setuptools"] + +[project] +name = "jmcomic" +authors = [{name = "hect0x7", email = "93357912+hect0x7@users.noreply.github.com"}] +description = "Python API For JMComic (禁漫天堂)" +readme = "README.md" +requires-python = ">=3.7" +license = {file = "LICENSE"} +keywords=['python', 'jmcomic', '18comic', '禁漫天堂', 'NSFW'] +classifiers=[ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: MIT License", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", +] +dependencies = [ + "commonx>=0.6.38", + "curl-cffi", + "pillow", + "pycryptodome", + "pyyaml", +] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/hect0x7/JMComic-Crawler-Python" +Documentation = "https://jmcomic.readthedocs.io" + +[project.scripts] +jmcomic = "jmcomic.cl:main" + +[tool.setuptools.dynamic] +version = {attr = "jmcomic.__version__"} \ No newline at end of file diff --git a/src/jmcomic/__init__.py b/src/jmcomic/__init__.py index e482e29..ff52583 100644 --- a/src/jmcomic/__init__.py +++ b/src/jmcomic/__init__.py @@ -2,7 +2,7 @@ # 被依赖方 <--- 使用方 # config <--- entity <--- toolkit <--- client <--- option <--- downloader -__version__ = '2.6.2' +__version__ = '2.6.3' from .api import * from .jm_plugin import * diff --git a/src/jmcomic/jm_config.py b/src/jmcomic/jm_config.py index 72880a2..986f623 100644 --- a/src/jmcomic/jm_config.py +++ b/src/jmcomic/jm_config.py @@ -136,7 +136,7 @@ class JmModuleConfig: ''') # 获取最新移动端API域名的地址 - API_URL_DOMAIN_SERVER = f'{PROT}jmappc01-1308024008.cos.ap-guangzhou.myqcloud.com/server-2024.txt' + API_URL_DOMAIN_SERVER = f'{PROT}jmapp03-1308024008.cos.ap-jakarta.myqcloud.com/server-2024.txt' APP_HEADERS_TEMPLATE = { 'Accept-Encoding': 'gzip, deflate', diff --git a/tests/test_jmcomic/test_jm_client.py b/tests/test_jmcomic/test_jm_client.py index c3c76be..ed072b6 100644 --- a/tests/test_jmcomic/test_jm_client.py +++ b/tests/test_jmcomic/test_jm_client.py @@ -17,6 +17,7 @@ class Test_Client(JmTestConfigurable): def test_search(self): page: JmSearchPage = self.client.search_tag('+无修正 +中文 -全彩') + print(f'总数: {page.total}, 分页大小: {page.page_size},页数: {page.page_count}') if len(page) >= 1: for aid, ainfo in page[0:1:1]: