Skip to content

Commit

Permalink
Fixed magisk release fetcher module.
Browse files Browse the repository at this point in the history
Added both canary branches to make Rapherion happy :P.
  • Loading branch information
Avinash Reddy authored Oct 2, 2019
1 parent 8d8a144 commit 15a0644
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions userbot/modules/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,26 @@


@register(outgoing=True, pattern="^.magisk$")
@errors_handler
async def magisk(request):
""" magisk latest releases """
url = 'https://raw.githubusercontent.com/topjohnwu/magisk_files/master/'
magisk_dict = {
"Stable":
"https://raw.githubusercontent.com/topjohnwu/magisk_files/master/stable.json",
"Beta":
"https://raw.githubusercontent.com/topjohnwu/magisk_files/master/beta.json",
"Canary (Release)":
"https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/release.json",
"Canary (Debug)":
"https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/debug.json"
}
releases = 'Latest Magisk Releases:\n'
for variant in ['stable', 'beta', 'canary_builds/canary']:
data = get(url + variant + '.json').json()
name = variant.split('_')[0].capitalize()
for name, release_url in magisk_dict.items():
data = get(release_url).json()
releases += f'{name}: [ZIP v{data["magisk"]["version"]}]({data["magisk"]["link"]}) | ' \
f'[APK v{data["app"]["version"]}]({data["app"]["link"]}) | ' \
f'[Uninstaller]({data["uninstaller"]["link"]})\n'
await request.edit(releases)


@register(outgoing=True, pattern=r"^.device(?: |$)(\S*)")
@errors_handler
async def device_info(request):
Expand Down

0 comments on commit 15a0644

Please sign in to comment.