diff --git a/.github/site-list.py b/.github/site-list.py new file mode 100644 index 00000000..fe86a78f --- /dev/null +++ b/.github/site-list.py @@ -0,0 +1,36 @@ +#!/usr/bin/python3 + +from glob import glob +from re import search, compile, sub + +# Globals +URL_REGEX = compile("override val mainUrl(?:\:\s?String)?[^\"']+[\"'](https?://[a-zA-Z0-9\.-]+)[\"']") +START_MARKER = "" +END_MARKER = "" +GLOB = "app/src/main/java/com/lagradost/cloudstream3/*providers/*Provider.kt" + +sites = [] + +for path in glob(GLOB): + with open(path, "r", encoding='utf-8') as file: + try: + sites.append(search(URL_REGEX, file.read()).groups()[0]) + except Exception as ex: + print("{0}: {1}".format(path, ex)) + +with open("README.md", "r+", encoding='utf-8') as readme: + raw = readme.read() + if START_MARKER not in raw or END_MARKER not in raw: + raise RuntimeError("Missing start and end markers") + readme.seek(0) + + readme.write(raw.split(START_MARKER)[0]) + readme.write(START_MARKER+"\n") + + for site in sites: + readme.write("- [{0}]({1}) \n".format(sub("^https?://", "", site), site)) + + readme.write(END_MARKER) + readme.write(raw.split(END_MARKER)[-1]) + + readme.truncate() diff --git a/.github/workflows/site_list.yml b/.github/workflows/site_list.yml new file mode 100644 index 00000000..1a3af5a8 --- /dev/null +++ b/.github/workflows/site_list.yml @@ -0,0 +1,31 @@ +name: Create site list + +on: + push: + branches: [ master ] + paths: + - 'README.md' + - 'app/src/main/java/com/lagradost/cloudstream3/*providers/*Provider.kt' + - '.github/workflows/site_list.yml' + - '.github/site-list.py' + +concurrency: + group: "site-list" + cancel-in-progress: true + +jobs: + create: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Edit README.md + run: | + python3 .github/site-list.py + - name: Commit to the repo + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add . + # "echo" returns true so the build succeeds, even if no changed files + git commit -m 'chore(docs): update list of sites' || echo + git push diff --git a/README.md b/README.md index e2066fc8..c58acd87 100644 --- a/README.md +++ b/README.md @@ -43,21 +43,25 @@ CloudStream 3 does not host any content on the app, and has no control over what It merely scrapes 3rd-party websites that are publicly accessable via any regular web browser. It is the responsibility of user to avoid any actions that might violate the laws governing his/her locality. Use CloudStream 3 at your own risk. ***Sites used:*** - -+ https://tenshi.moe - -+ https://wcostream.cc - -+ https://bestdubbedanime.com - -+ https://hdm.to - -+ https://www.vmovee.watch - -+ https://www.wcostream.com - -+ https://animepahe.com - -+ https://gogoanime.vc - -+ https://kawaiifu.com + + +- [trailers.to](https://trailers.to) +- [melomovie.com](https://melomovie.com) +- [hdm.to](https://hdm.to) +- [lookmovie.io](https://lookmovie.io) +- [asianload.cc](https://asianload.cc) +- [www.thenos.org](https://www.thenos.org) +- [asiaflix.app](https://asiaflix.app) +- [allmoviesforyou.co](https://allmoviesforyou.co) +- [vf-film.org](https://vf-film.org) +- [vidembed.cc](https://vidembed.cc) +- [www.vmovee.watch](https://www.vmovee.watch) +- [nyaa.si](https://nyaa.si) +- [www.wcostream.com](https://www.wcostream.com) +- [animeflick.net](https://animeflick.net) +- [tenshi.moe](https://tenshi.moe) +- [gogoanime.vc](https://gogoanime.vc) +- [wcostream.cc](https://wcostream.cc) +- [kawaiifu.com](https://kawaiifu.com) +- [bestdubbedanime.com](https://bestdubbedanime.com) +