Skip to content

Commit

Permalink
dsv
Browse files Browse the repository at this point in the history
  • Loading branch information
code-rgb committed Aug 18, 2021
1 parent 2fa6a59 commit 70d466f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: "v0.1.0"
tag_name: "v0.1.1"
name: Release
draft: false
files: ./release/*
Expand Down
5 changes: 4 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ mkdir -p pakages && mv *.apk pakages/
tar -czvf pakages.tar.gz pakages
mkdir -p release
mv pakages.tar.gz release/
# test -f "nikgapps.zip" && mv "nikgapps.zip" release/

if [[ -f "nikgapps.zip" ]]; then
mv "nikgapps.zip" release/
fi
4 changes: 2 additions & 2 deletions xapps2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ async def limit_coro(


async def main():
re.compile(r"[^A-Za-z0-9]")

async with ApkDL() as apk_dl:

with open("config.yaml", "r") as f:
apps_conf = yaml.load(f, Loader=yaml.FullLoader)

tasks: List = []

sem = asyncio.Semaphore(8)
sem = asyncio.Semaphore(6)

for addon in apps_conf["addons"]:
if func := getattr(apk_dl, addon, None):
Expand Down
25 changes: 7 additions & 18 deletions xapps2/miscdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def __init__(self):
self.mixplorer_regex = re.compile(
r"(?<=/)attachments/mixplorer_v(?:[6-9]|\d{2,})-[\d-]+api[\w-]+-apk\.\d+"
)

super().__init__()

async def _get_json(self, url: str) -> Optional[Dict]:
Expand Down Expand Up @@ -55,19 +54,6 @@ async def mixplorer(self, varient: str = "") -> Optional[str]:
if match := self.mixplorer_regex.search(text):
return f"{Sources.xda}{match.group(0)}"

# async def vlc(self) -> Optional[str]:
# try:
# async with self.http.get(Sources.vlc) as resp:
# assert resp.status == 200
# text = await resp.text()
# version = BeautifulSoup(text, "lxml").findAll("a")[-1].get("href")[:-1]
# except Exception:
# version = "3.3.4"
# apk_url = f"{Sources.vlc}{version}/VLC-Android-{version}-{DEVICE.arch}.apk"
# async with self.http.get(apk_url) as apk:
# if apk.status == 200:
# return apk_url

async def json_api(self, link: str, args: List[str]) -> Optional[str]:
if resp := await self._get_json(link):
while len(args) != 0:
Expand Down Expand Up @@ -99,7 +85,10 @@ async def niksgapps(self, varient: str = "basic") -> Optional[str]:
if DEVICE.arch != "arm64-v8a":
return
if link := await get_nikgapps(DEVICE.android_str, varient):
return link
# async with self.http.get(link) as resp:
# assert resp.status == 200
# return resp.url # redirected direct download link
async with self.http.get(link) as resp:
assert resp.status == 200
text = await resp.text()
if match := re.search(
r"<a href=\"(?P<link>\S+)\">direct\slink</a>", text
):
return match.group("link")
11 changes: 7 additions & 4 deletions xapps2/nikgappsdl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__all__ = ["get_nikgapps"]

from typing import Iterator, Literal, Optional

import re
import feedparser


Expand All @@ -20,8 +20,11 @@ async def get_nikgapps(
gapp_choice = (f"nikgapps-{varient}-{arch}").lower()
async for sf_link in iter_releases(android_str):
if gapp_choice in sf_link.lower():
dl_link = f"{sf_link}?use_mirror=autoselect"
break
else:
dl_link = None
return dl_link
return
if match := re.match(
"https://sourceforge\.net/projects/nikgapps/files/(?P<file>\S+\.zip)(?:/download)?",
sf_link,
):
return f"https://sourceforge.net/settings/mirror_choices?projectname=nikgapps&filename={match.group('file')}"
8 changes: 0 additions & 8 deletions xapps2/test.py

This file was deleted.

0 comments on commit 70d466f

Please sign in to comment.