Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Fix #30
Browse files Browse the repository at this point in the history
  • Loading branch information
reisxd committed Jul 6, 2022
1 parent c035782 commit 6ea70ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ async function downloadYTApk (ytVersion) {
});
}

console.log('Due to an issue, please select 17.25.24. The GitHub issue: https://github.com/reisxd/revanced-builder/issues/30');

versionChoosen = await inquirer.prompt([
{
type: 'list',
Expand All @@ -157,13 +155,20 @@ async function downloadYTApk (ytVersion) {
]);
}
let apkVersion;
let apkVerSecond;

if (ytVersion) apkVersion = ytVersion.replace(/\./g, '-');
if (versionChoosen) apkVersion = versionChoosen.version.replace(/\./g, '-');
apkVerSecond = apkVersion;
const apkVersionSplit = apkVersion.split('-');
if (apkVersionSplit[1] >= 25) {
if (apkVersionSplit[2] >= 35) apkVerSecond += '-2';
}

const downloadLinkPage = await getPage(
`https://www.apkmirror.com/apk/google-inc/youtube/youtube-${apkVersion}-release/youtube-${apkVersion}-android-apk-download/`
`https://www.apkmirror.com/apk/google-inc/youtube/youtube-${apkVersion}-release/youtube-${apkVerSecond}-android-apk-download/`
);

const dlPage = load(downloadLinkPage);
const pageLink = dlPage('a[class^="accent_bg btn btn-flat downloadButton"]')
.first()
Expand Down

0 comments on commit 6ea70ea

Please sign in to comment.