diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..39066de --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +__pycache__ +uninstall.* +venv.* +/venv +/HTML \ No newline at end of file diff --git a/curl/beautify_json.py b/curl/beautify_json.py new file mode 100644 index 0000000..1b13f56 --- /dev/null +++ b/curl/beautify_json.py @@ -0,0 +1,23 @@ +import json +import os +from json.decoder import JSONDecodeError + +def pretty_print_json_file(input_file, output_file): + try: + with open(input_file, 'r', encoding='utf-8') as infile: + content = infile.read() + data = json.loads(content) + with open(output_file, 'w', encoding='utf-8') as outfile: + json.dump(data, outfile, indent=4) + except JSONDecodeError as e: + print(f"Error decoding JSON in {input_file}: {e}") + +# Hardcoding the input and output file paths +input_file = 'stats.json' +output_file = 'stats_temp.json' + +pretty_print_json_file(input_file, output_file) + +# Remove the original file and rename the beautified file +os.remove(input_file) +os.rename(output_file, input_file) \ No newline at end of file diff --git a/curl/curl_links.txt b/curl/curl_links.txt new file mode 100644 index 0000000..c13ccab --- /dev/null +++ b/curl/curl_links.txt @@ -0,0 +1,16 @@ +# Get Stats Using Battle.NET (Requires Numbers) +https://my.callofduty.com/api/papi-client/stats/cod/v1/title/mw/platform/battle/gamer/$PROF/profile/type/mp + +# Get Stats Using PSN +https://my.callofduty.com/api/papi-client/stats/cod/v1/title/mw/platform/psn/gamer/$PROF/profile/type/mp + +# Get Stats Using Xbox Live +https://my.callofduty.com/api/papi-client/stats/cod/v1/title/mw/platform/xbl/gamer/$PROF/profile/type/mp + +--- + +# Get Recent Games +https://my.callofduty.com/api/papi-client/crm/cod/v2/title/mw/platform/battle/gamer/$PROF/matches/mp/start/0/end/0/details + +# Get Maps & Game Modes (No $PROF Variable Needed) +https://my.callofduty.com/api/papi-client/ce/v1/title/mw/platform/battle/gameType/mp/communityMapData/availability \ No newline at end of file diff --git a/curl/get_stats.ps1 b/curl/get_stats.ps1 new file mode 100644 index 0000000..cb9f6af --- /dev/null +++ b/curl/get_stats.ps1 @@ -0,0 +1,13 @@ +# Set your default values here +$PROF = "Ahrimdon%231597" # The % replaces the # for the Activision ID (e.g. Ahrimdon%231597) +# You do not need numbers for PSN or XBL +# Delete $PROF when getting maps and game modes. +$COOKIE_VALUE = "ACCT_SSO_COOKIE" + +$URL = "AddLinkHere" +$USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" +$OUTPUT_FILE = "stats.json" + +curl -v $URL -H "Cookie: ACT_SSO_COOKIE=$COOKIE_VALUE" -H "User-Agent: $USER_AGENT" -o $OUTPUT_FILE + +# Replace \ No newline at end of file diff --git a/deps/DateTime-5.2-py3-none-any.whl b/deps/DateTime-5.2-py3-none-any.whl new file mode 100644 index 0000000..d1fce87 Binary files /dev/null and b/deps/DateTime-5.2-py3-none-any.whl differ diff --git a/deps/aiohttp-3.8.5-cp39-cp39-win_amd64.whl b/deps/aiohttp-3.8.5-cp39-cp39-win_amd64.whl new file mode 100644 index 0000000..e5013c6 Binary files /dev/null and b/deps/aiohttp-3.8.5-cp39-cp39-win_amd64.whl differ diff --git a/deps/aiosignal-1.3.1-py3-none-any.whl b/deps/aiosignal-1.3.1-py3-none-any.whl new file mode 100644 index 0000000..41a992b Binary files /dev/null and b/deps/aiosignal-1.3.1-py3-none-any.whl differ diff --git a/deps/async_timeout-4.0.3-py3-none-any.whl b/deps/async_timeout-4.0.3-py3-none-any.whl new file mode 100644 index 0000000..d802d01 Binary files /dev/null and b/deps/async_timeout-4.0.3-py3-none-any.whl differ diff --git a/deps/asyncio-3.4.3-py3-none-any.whl b/deps/asyncio-3.4.3-py3-none-any.whl new file mode 100644 index 0000000..7b0124a Binary files /dev/null and b/deps/asyncio-3.4.3-py3-none-any.whl differ diff --git a/deps/attrs-23.1.0-py3-none-any.whl b/deps/attrs-23.1.0-py3-none-any.whl new file mode 100644 index 0000000..6991e6a Binary files /dev/null and b/deps/attrs-23.1.0-py3-none-any.whl differ diff --git a/deps/certifi-2023.7.22-py3-none-any.whl b/deps/certifi-2023.7.22-py3-none-any.whl new file mode 100644 index 0000000..78dfe27 Binary files /dev/null and b/deps/certifi-2023.7.22-py3-none-any.whl differ diff --git a/deps/charset_normalizer-3.3.0-cp39-cp39-win_amd64.whl b/deps/charset_normalizer-3.3.0-cp39-cp39-win_amd64.whl new file mode 100644 index 0000000..0de9fe7 Binary files /dev/null and b/deps/charset_normalizer-3.3.0-cp39-cp39-win_amd64.whl differ diff --git a/deps/enum34-1.1.10-py3-none-any.whl b/deps/enum34-1.1.10-py3-none-any.whl new file mode 100644 index 0000000..298ccce Binary files /dev/null and b/deps/enum34-1.1.10-py3-none-any.whl differ diff --git a/deps/frozenlist-1.4.0-cp39-cp39-win_amd64.whl b/deps/frozenlist-1.4.0-cp39-cp39-win_amd64.whl new file mode 100644 index 0000000..cf0a653 Binary files /dev/null and b/deps/frozenlist-1.4.0-cp39-cp39-win_amd64.whl differ diff --git a/deps/idna-3.4-py3-none-any.whl b/deps/idna-3.4-py3-none-any.whl new file mode 100644 index 0000000..7343c68 Binary files /dev/null and b/deps/idna-3.4-py3-none-any.whl differ diff --git a/deps/multidict-6.0.4-cp39-cp39-win_amd64.whl b/deps/multidict-6.0.4-cp39-cp39-win_amd64.whl new file mode 100644 index 0000000..47be79a Binary files /dev/null and b/deps/multidict-6.0.4-cp39-cp39-win_amd64.whl differ diff --git a/deps/pytz-2023.3.post1-py2.py3-none-any.whl b/deps/pytz-2023.3.post1-py2.py3-none-any.whl new file mode 100644 index 0000000..e6a4b3f Binary files /dev/null and b/deps/pytz-2023.3.post1-py2.py3-none-any.whl differ diff --git a/deps/requests-2.31.0-py3-none-any.whl b/deps/requests-2.31.0-py3-none-any.whl new file mode 100644 index 0000000..bfd5d2e Binary files /dev/null and b/deps/requests-2.31.0-py3-none-any.whl differ diff --git a/deps/setuptools-68.2.2-py3-none-any.whl b/deps/setuptools-68.2.2-py3-none-any.whl new file mode 100644 index 0000000..d4be906 Binary files /dev/null and b/deps/setuptools-68.2.2-py3-none-any.whl differ diff --git a/deps/urllib3-2.0.6-py3-none-any.whl b/deps/urllib3-2.0.6-py3-none-any.whl new file mode 100644 index 0000000..11ed7ae Binary files /dev/null and b/deps/urllib3-2.0.6-py3-none-any.whl differ diff --git a/deps/uuid-1.30.tar.gz b/deps/uuid-1.30.tar.gz new file mode 100644 index 0000000..2b28f8f Binary files /dev/null and b/deps/uuid-1.30.tar.gz differ diff --git a/deps/wheel-0.41.2-py3-none-any.whl b/deps/wheel-0.41.2-py3-none-any.whl new file mode 100644 index 0000000..f2befff Binary files /dev/null and b/deps/wheel-0.41.2-py3-none-any.whl differ diff --git a/deps/yarl-1.9.2-cp39-cp39-win_amd64.whl b/deps/yarl-1.9.2-cp39-cp39-win_amd64.whl new file mode 100644 index 0000000..2152eac Binary files /dev/null and b/deps/yarl-1.9.2-cp39-cp39-win_amd64.whl differ diff --git a/deps/zope.interface-6.0-cp39-cp39-win_amd64.whl b/deps/zope.interface-6.0-cp39-cp39-win_amd64.whl new file mode 100644 index 0000000..77f201e Binary files /dev/null and b/deps/zope.interface-6.0-cp39-cp39-win_amd64.whl differ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3186655 --- /dev/null +++ b/setup.py @@ -0,0 +1,41 @@ +import os +import subprocess +import venv + +def deps_exists(): + return os.path.exists('deps') + +def create_venv(): + venv.create('venv', with_pip=True) + # Create activation scripts + with open("venv.ps1", "w") as f: + f.write("venv\\Scripts\\Activate.ps1") + + with open("venv.bat", "w") as f: + f.write("venv\\Scripts\\activate") + +def upgrade_pip(): + subprocess.check_call([os.path.join('venv', 'Scripts', 'python'), '-m', 'pip', 'install', '--upgrade', 'pip']) + +def install_wheel(): + subprocess.check_call([os.path.join('venv', 'Scripts', 'pip'), 'install', '--no-index', '--find-links=deps', 'wheel']) + +def install_requirements_in_venv(): + # Use the full path to the wheel file + wheel_path = os.path.join('src', 'cod_api-2.0.1-py3-none-any.whl') + subprocess.check_call([os.path.join('venv', 'Scripts', 'pip'), 'install', '--no-index', '--find-links=deps', wheel_path]) + +if __name__ == "__main__": + if not deps_exists(): + print("Error: 'deps' directory does not exist!") + exit(1) + + print("Creating virtual environment...") + create_venv() + print("Upgrading pip...") + upgrade_pip() + print("Installing wheel...") + install_wheel() + print("Installing packages in the virtual environment...") + install_requirements_in_venv() # Call the function to install the requirements + print("Setup complete.") \ No newline at end of file