Repository: hect0x7/JMComic-APK Branch: master Commit: 9103088e7230 Files: 6 Total size: 8.8 KB Directory structure: gitextract_izt0_4ul/ ├── .github/ │ └── workflows/ │ └── auto_release.yml ├── APK_VERSION.txt ├── README.md ├── main.py ├── op.yml └── requirements.txt ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/auto_release.yml ================================================ # This is a basic workflow to help you get started with Actions name: Check JMComic Android APK # Controls when the workflow will run on: push: workflow_dispatch: schedule: - cron: '0 */2 * * *' permissions: contents: write # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Python 3.11 uses: actions/setup-python@v4 with: python-version: "3.11" - name: Install Dependency run: | python -m pip install --upgrade pip pip install jmcomic - name: Run Script id: script run: | python main.py - name: Release if: ${{ steps.script.outputs.found_new == 'true'}} uses: softprops/action-gh-release@v1 with: name: v${{ steps.script.outputs.new_ver }} tag_name: ${{ steps.script.outputs.new_ver }} draft: false files: | ${{ steps.script.outputs.new_ver }}.apk body: | 禁漫APP v${{ steps.script.outputs.new_ver }} 你可以直接下载Assets的`${{ steps.script.outputs.new_ver }}.apk`使用,或者从禁漫官网下载: 禁漫官网的`${{ steps.script.outputs.new_ver }}.apk`下载链接: 1. [${{ steps.script.outputs.download_path1 }}](${{ steps.script.outputs.download_path1 }}) 2. [${{ steps.script.outputs.download_path2 }}](${{ steps.script.outputs.download_path2 }}) 3. [https://18comic.vip/stray](https://18comic.vip/stray/)(发布页) `${{ steps.script.outputs.new_ver }}.apk`的更新信息: > ${{ steps.script.outputs.desc }} - name: Commit if: ${{ steps.script.outputs.found_new == 'true'}} run: | # Extract the version number from the previous step version=${{ steps.script.outputs.new_ver }} git config --global user.email "93357912+hect0x7@users.noreply.github.com" git config --global user.name "hect0x7" git tag -a "v$version" -m "Version $version" git add ./APK_VERSION.txt git commit -m "update APK_VERSION.txt" git push echo "finished" ================================================ FILE: APK_VERSION.txt ================================================ 2.0.18 ================================================ FILE: README.md ================================================
基于jmcomic库自动检查禁漫APK更新
[](https://github.com/hect0x7) [](https://github.com/hect0x7/JMComic-APK/releases/latest) [](https://github.com/hect0x7/JMComic-APK/releases/latest)')) download_new_ver(new_ver, download_path) def fetch_apk_info_via_html(): resp = html_cl.get_jm_html('/stray/?utm_source=18comic') apk_version_pattern = re.compile(r'a href="(/static/apk/(.*?).apk)"') match = PatternTool.require_match(resp.text, apk_version_pattern, '未匹配上apk下载路径', None) download_path, new_ver = match[1], match[2] return new_ver, download_path def get_download_path(url): try: domain = JmcomicText.parse_to_jm_domain(url) return url.replace(JmModuleConfig.PROT, '').replace(domain, '') except Exception as e: jm_log('get_download_path', f'{e}: [{url}]') return url.replace(JmModuleConfig.PROT, '') def fetch_apk_info_via_api(): resp = api_cl.setting() jm_log('apk.setting', json.dumps(resp.res_data, indent=2, ensure_ascii=False)) data = resp.model_data version = data.jm3_version return version, get_download_path(data.jm3_download_url), data.jm3_version_info if __name__ == '__main__': check_apk() ================================================ FILE: op.yml ================================================ client: domain: html: [ jmcomic1.me, jmcomic.me ] ================================================ FILE: requirements.txt ================================================ jmcomic