Skip to content

Instantly share code, notes, and snippets.

@dannycreations
Last active June 6, 2024 05:19
Show Gist options
  • Save dannycreations/e128973457d0e3f31b701eb0bc0ac55f to your computer and use it in GitHub Desktop.
Save dannycreations/e128973457d0e3f31b701eb0bc0ac55f to your computer and use it in GitHub Desktop.

Cloning the repository

git clone --filter=blob:none --sparse https://github.com/dannycreations/aniyomi-extensions
cd aniyomi-extensions

git sparse-checkout set --cone --sparse-index
git sparse-checkout add buildSrc core gradle lib
git sparse-checkout add src/id/oploverz
git sparse-checkout add src/id/samehadaku

git remote add upstream https://github.com/aniyomiorg/aniyomi-extensions
git remote set-url --push upstream no_pushing
git config remote.upstream.fetch "+refs/heads/master:refs/remotes/upstream/master"
git remote update
git branch master -u upstream/master

git config remote.origin.prune true
git config pull.ff only
git config alias.sync-master '!git switch master && git fetch upstream && git reset --keep FETCH_HEAD'

git sparse-checkout reapply

Running

// https://oploverz.ltd/anime/
// https://samehadaku.care/daftar-anime-2/
;(function () {
const filters = $('span.sec1 > div.filter.dropdown')
for (const filter of filters) {
const element = $(filter)
const title = element.find('.filter_title').text()
if (title === 'Search') continue
let ITEMS = element.find('ul > li')
if (!ITEMS.length) ITEMS = element.find('td > label')
let KEY_NAME = '',
KEY_LIST = []
for (const item of ITEMS) {
const element = $(item)
let title = element.text().trim()
if (title === 'Sort by') {
title = element.find('label').text().trim()
}
const input = element.find('input')
const key = input.val()
KEY_NAME = input.attr('name')
KEY_LIST.push(`Pair("${title}", "${key}")`)
}
console.log(KEY_NAME, KEY_LIST.join(',\n'), '\n\n')
}
console.log(`Total category: ${filters.length}`)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment