Jump to content

Fetcher - A simple python script wrote to filter appstore results.


1 post in this topic

Recommended Posts

Updated (edited)

Fetcher

Made only Json & Requests

Fetcher is a light weight, python script that also outputs all data to a text file in a formatted manor. I will probably update this once or twice.

Cant post on git because they deleted my main github :/

This color means default or contextual text.

It can be used to

  1. Sort versions from highest to lowest
  2. Search for apps via terms ("Last day on Earth")
  3. Custom entity input ("software,iPadSoftware")
  4. Version sorting (BUGGY, I wouldnt really call this a feature bc of its state but its here anyway)
  5. Search w/ country codes ("US")
  6. Limit results
  7. Search results via Genre ("Games")
  8. Filters any junk data from results (art work, description etc)
  9. Callback support (edit the code as it wasn't built with it in mind)

Might be buggy, not gonna always sort things well. Will try its best <3.

Plans:

  1. Almost 0 Plans for this. Might add more sorting/filters to the script.

Installing requests:

Quote

pip install requests

 

Code:

import json
import os
import time
import requests

DEBUG = False
PRINT_RESPONSE = False # recommeneded as false because lots of data

def filter(data):
    if not isinstance(data, list):
        raise ValueError("Input data should be a list of dictionaries.")
    
    filtered_data = []
    for item in data:
        if isinstance(item, dict):
            # items to filter, copy paste
            filtered_item = {
                "currentVersionReleaseDate": item.get("currentVersionReleaseDate"),
                "primaryGenreName": item.get("primaryGenreName"),
                "bundleId": item.get("bundleId"), # "com.attackgalaxyshooter.galaxyspaceshooter2020"
                "sellerName": item.get("sellerName"),
                "version": item.get("version"),
                "trackName": item.get("trackName"), # "Galaxy War: Space Shooter"
                "kind": item.get("kind"), # software
                "releaseDate": item.get("releaseDate"),
                "collectionViewUrl": item.get("collectionViewUrl"),
                "genres": item.get("genres"),
            }
            if DEBUG: print(json.dumps(filtered_item, indent=4))
            filtered_data.append(filtered_item)
        else:
            print(f"Skipping item, not a dictionary: {item}")
    return filtered_data


def sorter(data, target, high=False):
    try:

        s = sorted(data, key=lambda x: x[target], reverse=high)

        if DEBUG:
            print(json.dumps(s, indent=4))

        return s
    except Exception as err:
        print(f"[!] Error while sorting: {err}")
        exit(1)

def sortGenre(data, target, includeAllMatching = False):
    sorted_genres = [] # store here
    
    for genre in data:
        
        if isinstance(genre, dict):
        
            genre_name = genre.get('primaryGenreName')
            genre_list = genre.get('genres')

            # look for all that match the target
            if includeAllMatching: 
                if genre_name == target or target in genre_list: 
                    sorted_genres.append(genre)
            else:
                # only get the matching primaryGenreName
                if genre_name == target:
                    sorted_genres.append(genre)

    return sorted_genres

def sortVer(data, high=False):
    return sorter(data, 'version', high)

def versortCheck(data):
    shouldVerSort = str(input("Sort version? (y/n): ")).upper()

    if shouldVerSort == "Y" or shouldVerSort == "YES":
            
        sortHigh = str(input("Sort version High? (y/n) (n = low -> high): ")).upper()
            
        if sortHigh == "Y" or sortHigh == "YES":
            return sortVer(data, True)
        elif sortHigh == "N" or sortHigh == "NO":
            return sortVer(data, False)
        else:
            return data
    else:
        return data

def gensortCheck(data, target):
    shouldGenSort = str(input(f"Sort Genre by {target}? (y/n): ")).upper()

    if shouldGenSort == "Y" or shouldGenSort == "YES":
        return sortGenre(data, target)
    else:
        return data # since they dont want to genre sort we will then return the data as it is

def save(data, output):
    
    with open(output, 'a+') as f:
        
        if f.writable:
            f.write(json.dumps(data, indent=4))
            f.close()
        
            if f.closed:
                print(f"[+] File was closed and wrote to {output}")
            else:
                ValueError(f"[!] Issue checking if the file is closed successfully. Please make sure you/the program has sufficent privs.")
        
        else:
            ValueError(f"[!] Cannot write to {output}")

def main():
    try:
        limit = int(input("Limit (Number): ")) or 20
        entity = str(input("Entity to search (software,iPadSoftware): ")) or "software,iPadSoftware" 
        country = str(input("Country Code (US): ")).lower() or "us" # country code (us = america)
        term = str(input("Term: ")) or "terminator"
        targetGenre = str(input("Genre (\"Games\"): ")) or "games"
        
        if limit == 0: print("[!] Enter a value higher than 0"); main()

        # can add this back just do '&callback={callback}' in the url
        # callback = "fetch_with_cb_cb" # easy function parsing from result <3 apple

        output = str(input("Output file (result.txt): ")) or "results.txt"

        url = f"https://itunes.apple.com/search?limit={limit}&entity={entity}&country={country}&term={term}"

        res = requests.get(url)

        if PRINT_RESPONSE:
            print(json.dumps(res.json(), indent=4))

        if res.status_code != 200:
            ValueError(f"[!] Response code: {res.status_code}\nURL: {url}\nCorrect issues and try again.")
        
        if json.dumps(res.json().get('resultCount', int)) == '0':
            ValueError(f"[!] No results. Please correct any issues.\nLimit: {limit}\nEntity: {entity}\nCountry Code (default us): {country}\nSearch term: {term}")
        
        raw = res.json().get('results', []) # gets the results
        
        filtered = filter(raw)

        versorted = versortCheck(filtered) # i did this so i can shorten the code thats in the block.

        # we parse the return from versorted and then use that data
        gensorted = gensortCheck(versorted, targetGenre)
        
        # after we save it
        save(gensorted, output)

    except Exception as e:
        print(f"Uh oh you encountered an error!\n{e}")
        input("Press any key to continue")
        time.sleep(5)
        os.system('clear') # change to your distro/os clear equivilent. cls for win.
        main()

if __name__ == '__main__':
    if DEBUG: input("[!] WARNING YOU ARE USING DEBUG [!]\nPRESS ENTER TO CONTINUE\n")
    main()

Made this for fun. I know you can use the Decrypt IPA store for searching but this could be better due to the filters it gives. All outputs are in a Json string that is indented too for an easier read.

Updated by carpoa
if DEBUG == True -> if DEBUG

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Galaxy Defense: Fortress TD v0.13.2 [+4 Cheats]
      Modded/Hacked App: Galaxy Defense: Fortress TD By CYBERJOY LIMITED
      Bundle ID: com.cyberjoy.galaxydefense
      App Store Link: https://apps.apple.com/us/app/galaxy-defense-fortress-td/id6740189002?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Activate SVIP
       
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 96 replies
    • Galaxy Defense: Fortress TD v0.13.2 [+4 Jailed Cheats]
      Modded/Hacked App: Galaxy Defense: Fortress TD By CYBERJOY LIMITED
      Bundle ID: com.cyberjoy.galaxydefense
      App Store Link: https://apps.apple.com/us/app/galaxy-defense-fortress-td/id6740189002?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Activate SVIP
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 60 replies
    • Inkvasion v1.0.1 [+2 Jailed Cheats]
      Modded/Hacked App: Inkvasion By ChillyRoom Inc.
      Bundle ID: com.chillyroom.inkvasion
      App Store Link: https://apps.apple.com/us/app/inkvasion/id6499471518?uo=4



      🤩 Hack Features

      - Enemy Can't Attack Building
      - Unlimited Battle Resource
        • Thanks
        • Winner
      • 2 replies
    • Inkvasion v1.0.1 [+2 Cheats]
      Modded/Hacked App: Inkvasion By ChillyRoom Inc.
      Bundle ID: com.chillyroom.inkvasion
      App Store Link: https://apps.apple.com/us/app/inkvasion/id6499471518?uo=4



      🤩 Hack Features

      - Enemy Can't Attack Building
      - Unlimited Battle Resource
       
        • Winner
      • 3 replies
    • 鬼谷八荒 Tale of Immortal v1.0012 +4 Jailed Cheats [ Unlocked ]
      Modded/Hacked App: 鬼谷八荒 Tale of Immortal By HKWENXINTECHNOLOGYLIMITED
      Bundle ID: com.guigugame.guigubahuangoverseas
      App Store Link: https://apps.apple.com/us/app/%E9%AC%BC%E8%B0%B7%E5%85%AB%E8%8D%92-tale-of-immortal/id6742472194?uo=4

       


      🤩 Hack Features

      - God Mode
      - One-Hit Kill
      - Dumb AI
      -- All DLC Unlocked
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 55 replies
    • 鬼谷八荒 Tale of Immortal v1.0012 +4 Cheats [ Unlocked ]
      Modded/Hacked App: 鬼谷八荒 Tale of Immortal By HKWENXINTECHNOLOGYLIMITED
      Bundle ID: com.guigugame.guigubahuangoverseas
      App Store Link: https://apps.apple.com/us/app/%E9%AC%BC%E8%B0%B7%E5%85%AB%E8%8D%92-tale-of-immortal/id6742472194?uo=4

       
       

      🤩 Hack Features

      - God Mode
      - One-Hit Kill
      - Dumb AI
      -- All DLC Unlocked
        • Informative
        • Winner
        • Like
      • 9 replies
    • BOWBLITZ v25.10.20 Jailed Cheats +5
      Modded/Hacked App: BOWBLITZ By Hong Kong Kaboom Technology Co., Limited
      Bundle ID: com.ka60omgame.bowblitz
      App Store Link: https://apps.apple.com/us/app/bowblitz/id6740192739?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - God Mode
      - High Damage X10
      - No Shoot Cooldown
      - No Ads + Skip Ads
      - Unlocked PREMIUM Auto Play

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/201968-bowblitz-v251020-jailed-cheats-5/
        • Like
      • 1 reply
    • Zombie Waves-shooting game v2.1.2 Jailed Cheats +6
      Modded/Hacked App: Zombie Waves-shooting game By FUN FORMULA PTE. LTD.
      Bundle ID: com.ddup.zombiewaves.zw
      App Store Link: https://apps.apple.com/us/app/zombie-waves-shooting-game/id6443760593?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - God Mode
      - Infinite Ammo
      - No Reload
      - Increase Magnet Range
      - High Damage X10
      - High Fire Rate

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/201966-zombie-waves-shooting-game-v212-jailed-cheats-6/
        • Haha
        • Winner
        • Like
      • 2 replies
    • EvoCreo 2: Monster Trainer RPG v1.5.5 +8 Jailed Cheats [ Damage + More ]
      Modded/Hacked App: EvoCreo 2: Monster Trainer RPG By Ilmfinity Studios LLC
      Bundle ID: com.ilmfinity.evocreo2
      iTunes Store Link: https://apps.apple.com/us/app/evocreo-2-monster-trainer-rpg/id1499001662?uo=4

       


      🤩 Hack Features

      - Unlimited Money -> Will increase instead of decrease.
      - Unlimited Skill Points
      - Unlimited Bag Items -> Will increase instead of decrease.
      - Prestige Cleo Allowed
      - Max Creo Level -> Earn some XP.
      - Damage Multiplier - Linked -> Affects both you and enemy. Use carefully.
      - Free In-App Purchases
      - Unlock All Achievements/Badges
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 42 replies
    • EvoCreo 2: Monster Trainer RPG v1.5.5 +8 Cheats [ Damage + More ]
      Modded/Hacked App: EvoCreo 2: Monster Trainer RPG By Ilmfinity Studios LLC
      Bundle ID: com.ilmfinity.evocreo2
      iTunes Store Link: https://apps.apple.com/us/app/evocreo-2-monster-trainer-rpg/id1499001662?uo=4

       


      🤩 Hack Features

      - Unlimited Money -> Will increase instead of decrease.
      - Unlimited Skill Points
      - Unlimited Bag Items -> Will increase instead of decrease.
      - Prestige Cleo Allowed
      - Max Creo Level -> Earn some XP.
      - Damage Multiplier - Linked -> Affects both you and enemy. Use carefully.
      - Free In-App Purchases
      - Unlock All Achievements/Badges
        • Informative
        • Agree
        • Thanks
        • Like
      • 25 replies
    • MONOPOLY: The Board Game v1.15.8 +1 Jailed Cheat [ Everything Owned ]
      Modded/Hacked App: MONOPOLY: The Board Game By Marmalade Game Studio Limited
      Bundle ID: com.marmalade.monopoly
      iTunes Store Link: https://apps.apple.com/us/app/monopoly-the-board-game/id1477966166?uo=4


      Hack Features:
      - Everything Owned -> All packs, themes, boards, tokens, all purchased and owned.


      Jailbreak required hack(s): https://iosgods.com/topic/169254-monopoly-classic-board-game-all-versions-1-cheat-everything-owned/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 428 replies
    • MONOPOLY: The Board Game v1.15.8 +1 Cheat [ Everything Owned ]
      Modded/Hacked App: MONOPOLY: The Board Game By Marmalade Game Studio Limited
      Bundle ID: com.marmalade.monopoly
      iTunes Store Link: https://apps.apple.com/us/app/monopoly-the-board-game/id1477966166?uo=4


      Hack Features:
      - Everything Owned -> All packs, themes, boards, tokens, all purchased and owned.


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/169256-monopoly-classic-board-game-v189-1-jailed-cheat-everything-owned/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 211 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines