├── .flake8 ├── .github ├── dependabot.yml ├── label-actions.yml ├── semantic.yml └── workflows │ ├── codeql.yml │ ├── common-lint.yml │ ├── issues.yml │ └── update-db.yml ├── .gitignore ├── .readthedocs.yaml ├── LICENSE ├── README.md ├── gh-pages-template ├── assets │ ├── img │ │ └── no-logo.png │ └── js │ │ └── item_loader.js └── index.html ├── requirements-dev.txt ├── requirements.txt └── src ├── __init__.py ├── platforms.py └── update_db.py /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | filename = 3 | *.py 4 | max-line-length = 120 5 | extend-exclude = 6 | venv/ 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This file is centrally managed in https://github.com//.github/ 3 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in 4 | # the above-mentioned repo. 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "cargo" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | time: "07:30" 13 | open-pull-requests-limit: 10 14 | 15 | - package-ecosystem: "docker" 16 | directory: "/" 17 | schedule: 18 | interval: "daily" 19 | time: "08:00" 20 | open-pull-requests-limit: 10 21 | 22 | - package-ecosystem: "github-actions" 23 | directory: "/" 24 | schedule: 25 | interval: "daily" 26 | time: "08:30" 27 | open-pull-requests-limit: 10 28 | groups: 29 | docker-actions: 30 | applies-to: version-updates 31 | patterns: 32 | - "docker/*" 33 | github-actions: 34 | applies-to: version-updates 35 | patterns: 36 | - "actions/*" 37 | - "github/*" 38 | lizardbyte-actions: 39 | applies-to: version-updates 40 | patterns: 41 | - "LizardByte/*" 42 | 43 | - package-ecosystem: "npm" 44 | directory: "/" 45 | schedule: 46 | interval: "daily" 47 | time: "09:00" 48 | open-pull-requests-limit: 10 49 | groups: 50 | dev-dependencies: 51 | applies-to: version-updates 52 | dependency-type: "development" 53 | 54 | - package-ecosystem: "nuget" 55 | directory: "/" 56 | schedule: 57 | interval: "daily" 58 | time: "09:30" 59 | open-pull-requests-limit: 10 60 | 61 | - package-ecosystem: "pip" 62 | directory: "/" 63 | schedule: 64 | interval: "daily" 65 | time: "10:00" 66 | open-pull-requests-limit: 10 67 | groups: 68 | pytest-dependencies: 69 | applies-to: version-updates 70 | patterns: 71 | - "pytest*" 72 | 73 | - package-ecosystem: "gitsubmodule" 74 | directory: "/" 75 | schedule: 76 | interval: "daily" 77 | time: "10:30" 78 | open-pull-requests-limit: 10 79 | -------------------------------------------------------------------------------- /.github/label-actions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This file is centrally managed in https://github.com//.github/ 3 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in 4 | # the above-mentioned repo. 5 | 6 | # Configuration for Label Actions - https://github.com/dessant/label-actions 7 | 8 | added: 9 | comment: > 10 | This feature has been added and will be available in the next release. 11 | fixed: 12 | comment: > 13 | This issue has been fixed and will be available in the next release. 14 | invalid:duplicate: 15 | comment: > 16 | :wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue. 17 | close: true 18 | lock: true 19 | unlabel: 'status:awaiting-triage' 20 | 21 | -invalid:duplicate: 22 | reopen: true 23 | unlock: true 24 | 25 | invalid:support: 26 | comment: > 27 | :wave: @{issue-author}, we use the issue tracker exclusively for bug reports. 28 | However, this issue appears to be a support request. Please use our 29 | [Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks. 30 | close: true 31 | lock: true 32 | lock-reason: 'off-topic' 33 | unlabel: 'status:awaiting-triage' 34 | 35 | -invalid:support: 36 | reopen: true 37 | unlock: true 38 | 39 | invalid:template-incomplete: 40 | issues: 41 | comment: > 42 | :wave: @{issue-author}, please edit your issue to complete the template with 43 | all the required info. Your issue will be automatically closed in 5 days if 44 | the template is not completed. Thanks. 45 | prs: 46 | comment: > 47 | :wave: @{issue-author}, please edit your PR to complete the template with 48 | all the required info. Your PR will be automatically closed in 5 days if 49 | the template is not completed. Thanks. 50 | -------------------------------------------------------------------------------- /.github/semantic.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This file is centrally managed in https://github.com//.github/ 3 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in 4 | # the above-mentioned repo. 5 | 6 | # This is the configuration file for https://github.com/Ezard/semantic-prs 7 | 8 | enabled: true 9 | titleOnly: true # We only use the PR title as we squash and merge 10 | commitsOnly: false 11 | titleAndCommits: false 12 | anyCommit: false 13 | allowMergeCommits: false 14 | allowRevertCommits: false 15 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This workflow is centrally managed in https://github.com//.github/ 3 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in 4 | # the above-mentioned repo. 5 | 6 | # This workflow will analyze all supported languages in the repository using CodeQL Analysis. 7 | 8 | name: "CodeQL" 9 | permissions: 10 | contents: read 11 | 12 | on: 13 | push: 14 | branches: 15 | - master 16 | pull_request: 17 | branches: 18 | - master 19 | schedule: 20 | - cron: '00 12 * * 0' # every Sunday at 12:00 UTC 21 | 22 | concurrency: 23 | group: "${{ github.workflow }}-${{ github.ref }}" 24 | cancel-in-progress: true 25 | 26 | jobs: 27 | languages: 28 | name: Get language matrix 29 | outputs: 30 | matrix: ${{ steps.lang.outputs.result }} 31 | continue: ${{ steps.continue.outputs.result }} 32 | runs-on: ubuntu-latest 33 | steps: 34 | - name: Checkout repository 35 | uses: actions/checkout@v4 36 | 37 | - name: Get repo languages 38 | id: lang 39 | uses: actions/github-script@v7 40 | with: 41 | script: | 42 | // CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'] 43 | // Use only 'java' to analyze code written in Java, Kotlin or both 44 | // Use only 'javascript' to analyze code written in JavaScript, TypeScript or both 45 | // Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support 46 | const supported_languages = ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'] 47 | 48 | const remap_languages = { 49 | 'c++': 'cpp', 50 | 'c#': 'csharp', 51 | 'kotlin': 'java', 52 | 'typescript': 'javascript', 53 | } 54 | 55 | const repo = context.repo 56 | const response = await github.rest.repos.listLanguages(repo) 57 | let matrix = { 58 | "include": [] 59 | } 60 | 61 | // Track languages we've already added to avoid duplicates 62 | const addedLanguages = new Set() 63 | 64 | // Check if workflow files exist to determine if we should add actions language 65 | const fs = require('fs'); 66 | const hasYmlFiles = fs.existsSync('.github/workflows') && 67 | fs.readdirSync('.github/workflows').some(file => file.endsWith('.yml') || file.endsWith('.yaml')); 68 | 69 | // Add actions language if workflow files exist 70 | if (hasYmlFiles) { 71 | console.log('Found GitHub Actions workflow files. Adding actions to the matrix.'); 72 | matrix['include'].push({ 73 | "category": "/language:actions", 74 | "language": "actions", 75 | "name": "actions", 76 | "os": "ubuntu-latest" 77 | }); 78 | } 79 | 80 | for (let [key, value] of Object.entries(response.data)) { 81 | // remap language 82 | if (remap_languages[key.toLowerCase()]) { 83 | console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`) 84 | key = remap_languages[key.toLowerCase()] 85 | } 86 | 87 | const normalizedKey = key.toLowerCase() 88 | 89 | if (supported_languages.includes(normalizedKey) && !addedLanguages.has(normalizedKey)) { 90 | // Mark this language as added 91 | addedLanguages.add(normalizedKey) 92 | 93 | console.log(`Found supported language: ${normalizedKey}`) 94 | let osList = ['ubuntu-latest']; 95 | if (normalizedKey === 'swift') { 96 | osList = ['macos-latest']; 97 | } else if (normalizedKey === 'cpp') { 98 | osList = ['macos-latest', 'ubuntu-latest', 'windows-latest']; 99 | } 100 | for (let os of osList) { 101 | // set name for matrix 102 | let name = osList.length === 1 ? normalizedKey : `${normalizedKey}, ${os}` 103 | 104 | // set category for matrix 105 | let category = `/language:${normalizedKey}` 106 | if (normalizedKey === 'cpp') { 107 | category = `/language:cpp-${os.split('-')[0]}` 108 | } 109 | 110 | // add to matrix 111 | matrix['include'].push({ 112 | "category": category, 113 | "language": normalizedKey, 114 | "name": name, 115 | "os": os 116 | }) 117 | } 118 | } 119 | } 120 | 121 | // print languages 122 | console.log(`matrix: ${JSON.stringify(matrix)}`) 123 | 124 | return matrix 125 | 126 | - name: Continue 127 | id: continue 128 | uses: actions/github-script@v7 129 | with: 130 | script: | 131 | // if matrix['include'] is an empty list return false, otherwise true 132 | const matrix = ${{ steps.lang.outputs.result }} // this is already json encoded 133 | 134 | if (matrix['include'].length == 0) { 135 | return false 136 | } else { 137 | return true 138 | } 139 | 140 | analyze: 141 | name: Analyze (${{ matrix.name }}) 142 | if: needs.languages.outputs.continue == 'true' 143 | defaults: 144 | run: 145 | shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} 146 | env: 147 | GITHUB_CODEQL_BUILD: true 148 | needs: languages 149 | permissions: 150 | actions: read 151 | contents: read 152 | security-events: write 153 | runs-on: ${{ matrix.os || 'ubuntu-latest' }} 154 | strategy: 155 | fail-fast: false 156 | matrix: ${{ fromJson(needs.languages.outputs.matrix) }} 157 | timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} 158 | steps: 159 | - name: Maximize build space 160 | if: >- 161 | runner.os == 'Linux' && 162 | matrix.language == 'cpp' 163 | uses: easimon/maximize-build-space@v10 164 | with: 165 | root-reserve-mb: 30720 166 | remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }} 167 | remove-android: 'true' 168 | remove-haskell: 'true' 169 | remove-codeql: 'false' 170 | remove-docker-images: 'true' 171 | 172 | - name: Checkout repository 173 | uses: actions/checkout@v4 174 | with: 175 | submodules: recursive 176 | 177 | - name: Setup msys2 178 | if: >- 179 | runner.os == 'Windows' && 180 | matrix.language == 'cpp' 181 | uses: msys2/setup-msys2@v2 182 | with: 183 | msystem: ucrt64 184 | update: true 185 | 186 | # Initializes the CodeQL tools for scanning. 187 | - name: Initialize CodeQL 188 | uses: github/codeql-action/init@v3 189 | with: 190 | languages: ${{ matrix.language }} 191 | # If you wish to specify custom queries, you can do so here or in a config file. 192 | # By default, queries listed here will override any specified in a config file. 193 | # Prefix the list here with "+" to use these queries and those in the config file. 194 | 195 | # yamllint disable-line rule:line-length 196 | # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 197 | # queries: security-extended,security-and-quality 198 | config: | 199 | paths-ignore: 200 | - build 201 | - node_modules 202 | - third-party 203 | 204 | # Pre autobuild 205 | # create a file named .codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh in the root of your repository 206 | - name: Prebuild 207 | id: prebuild 208 | run: | 209 | # check if prebuild script exists 210 | filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh" 211 | if [ -f "./${filename}" ]; then 212 | echo "Running prebuild script: ${filename}" 213 | ./${filename} 214 | fi 215 | 216 | # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). 217 | - name: Autobuild 218 | if: steps.prebuild.outputs.skip_autobuild != 'true' 219 | uses: github/codeql-action/autobuild@v3 220 | 221 | - name: Perform CodeQL Analysis 222 | uses: github/codeql-action/analyze@v3 223 | with: 224 | category: "${{ matrix.category }}" 225 | output: sarif-results 226 | upload: failure-only 227 | 228 | - name: filter-sarif 229 | uses: advanced-security/filter-sarif@v1 230 | with: 231 | input: sarif-results/${{ matrix.language }}.sarif 232 | output: sarif-results/${{ matrix.language }}.sarif 233 | patterns: | 234 | -build/** 235 | -node_modules/** 236 | -third\-party/** 237 | 238 | - name: Upload SARIF 239 | uses: github/codeql-action/upload-sarif@v3 240 | with: 241 | category: "${{ matrix.category }}" 242 | sarif_file: sarif-results/${{ matrix.language }}.sarif 243 | 244 | - name: Upload loc as a Build Artifact 245 | uses: actions/upload-artifact@v4 246 | with: 247 | name: sarif-results-${{ matrix.language }}-${{ runner.os }} 248 | path: sarif-results 249 | if-no-files-found: error 250 | retention-days: 1 251 | -------------------------------------------------------------------------------- /.github/workflows/common-lint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This workflow is centrally managed in https://github.com//.github/ 3 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in 4 | # the above-mentioned repo. 5 | 6 | # Common linting. 7 | 8 | name: common lint 9 | permissions: 10 | contents: read 11 | 12 | on: 13 | pull_request: 14 | branches: 15 | - master 16 | types: 17 | - opened 18 | - synchronize 19 | - reopened 20 | 21 | concurrency: 22 | group: "${{ github.workflow }}-${{ github.ref }}" 23 | cancel-in-progress: true 24 | 25 | jobs: 26 | lint: 27 | name: Common Lint 28 | runs-on: ubuntu-latest 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v4 32 | 33 | - name: Set up Python 34 | uses: actions/setup-python@v5 35 | with: 36 | python-version: '3.12' 37 | 38 | - name: Install dependencies 39 | run: | 40 | python -m pip install --upgrade \ 41 | pip \ 42 | setuptools \ 43 | wheel \ 44 | cmakelang \ 45 | flake8 \ 46 | nb-clean \ 47 | nbqa[toolchain] 48 | 49 | - name: C++ - find files 50 | id: cpp_files 51 | run: | 52 | # find files 53 | found_files=$(find . -type f \ 54 | -iname "*.c" -o \ 55 | -iname "*.cpp" -o \ 56 | -iname "*.h" -o \ 57 | -iname "*.hpp" -o \ 58 | -iname "*.m" -o \ 59 | -iname "*.mm" \ 60 | ) 61 | ignore_files=$(find . -type f -iname ".clang-format-ignore") 62 | 63 | # Loop through each C++ file 64 | for file in $found_files; do 65 | for ignore_file in $ignore_files; do 66 | ignore_directory=$(dirname "$ignore_file") 67 | # if directory of ignore_file is beginning of file 68 | if [[ "$file" == "$ignore_directory"* ]]; then 69 | echo "ignoring file: ${file}" 70 | found_files="${found_files//${file}/}" 71 | break 1 72 | fi 73 | done 74 | done 75 | 76 | # remove empty lines 77 | found_files=$(echo "$found_files" | sed '/^\s*$/d') 78 | 79 | echo "found cpp files: ${found_files}" 80 | 81 | # do not quote to keep this as a single line 82 | echo found_files=${found_files} >> $GITHUB_OUTPUT 83 | 84 | - name: C++ - Clang format lint 85 | if: always() && steps.cpp_files.outputs.found_files 86 | uses: DoozyX/clang-format-lint-action@v0.20 87 | with: 88 | source: ${{ steps.cpp_files.outputs.found_files }} 89 | clangFormatVersion: '20' 90 | extensions: 'c,cpp,h,hpp,m,mm' 91 | style: file 92 | inplace: false 93 | 94 | - name: CMake - find files 95 | id: cmake_files 96 | if: always() 97 | run: | 98 | # find files 99 | found_files=$(find . -type f -iname "CMakeLists.txt" -o -iname "*.cmake") 100 | ignore_files=$(find . -type f -iname ".cmake-lint-ignore") 101 | 102 | # Loop through each C++ file 103 | for file in $found_files; do 104 | for ignore_file in $ignore_files; do 105 | ignore_directory=$(dirname "$ignore_file") 106 | # if directory of ignore_file is beginning of file 107 | if [[ "$file" == "$ignore_directory"* ]]; then 108 | echo "ignoring file: ${file}" 109 | found_files="${found_files//${file}/}" 110 | break 1 111 | fi 112 | done 113 | done 114 | 115 | # remove empty lines 116 | found_files=$(echo "$found_files" | sed '/^\s*$/d') 117 | 118 | echo "found cmake files: ${found_files}" 119 | 120 | # do not quote to keep this as a single line 121 | echo found_files=${found_files} >> $GITHUB_OUTPUT 122 | 123 | - name: CMake - cmake-lint 124 | if: always() && steps.cmake_files.outputs.found_files 125 | run: | 126 | cmake-lint --line-width 120 --tab-size 4 ${{ steps.cmake_files.outputs.found_files }} 127 | 128 | - name: Docker - find files 129 | id: docker_files 130 | if: always() 131 | run: | 132 | found_files=$(find . -type f -iname "Dockerfile" -o -iname "*.dockerfile") 133 | 134 | echo "found_files: ${found_files}" 135 | 136 | # do not quote to keep this as a single line 137 | echo found_files=${found_files} >> $GITHUB_OUTPUT 138 | 139 | - name: Docker - hadolint 140 | if: always() && steps.docker_files.outputs.found_files 141 | run: | 142 | docker pull hadolint/hadolint 143 | 144 | # create hadolint config file 145 | cat < .hadolint.yaml 146 | --- 147 | ignored: 148 | - DL3008 149 | - DL3013 150 | - DL3016 151 | - DL3018 152 | - DL3028 153 | - DL3059 154 | EOF 155 | 156 | failed=0 157 | failed_files="" 158 | 159 | for file in ${{ steps.docker_files.outputs.found_files }}; do 160 | echo "::group::${file}" 161 | docker run --rm -i \ 162 | -e "NO_COLOR=0" \ 163 | -e "HADOLINT_VERBOSE=1" \ 164 | -v $(pwd)/.hadolint.yaml:/.config/hadolint.yaml \ 165 | hadolint/hadolint < $file || { 166 | failed=1 167 | failed_files="$failed_files $file" 168 | } 169 | echo "::endgroup::" 170 | done 171 | 172 | if [ $failed -ne 0 ]; then 173 | echo "::error:: hadolint failed for the following files: $failed_files" 174 | exit 1 175 | fi 176 | 177 | - name: PowerShell - PSScriptAnalyzer 178 | if: always() 179 | shell: pwsh 180 | run: | 181 | # PSScriptAnalyzer is already installed on GitHub runners 182 | 183 | # To see a list of available rules, run the following command: 184 | # Get-ScriptAnalyzerRule | Format-List 185 | 186 | # Create PSScriptAnalyzer config file only if it doesn't exist 187 | if (-not (Test-Path ./PSScriptAnalyzerSettings.psd1)) { 188 | @' 189 | @{ 190 | Severity=@( 191 | 'Error', 192 | 'Information', 193 | 'Warning' 194 | ) 195 | ExcludeRules=@( 196 | 'PSAlignAssignmentStatement' 197 | ) 198 | } 199 | '@ | Out-File -FilePath ./PSScriptAnalyzerSettings.psd1 200 | } 201 | 202 | # Run PSScriptAnalyzer recursively on the whole repository 203 | Write-Host "::group::Analyzing PowerShell files" 204 | $results = Invoke-ScriptAnalyzer -Path "." -Recurse 205 | 206 | if ($results) { 207 | $results | Format-Table -AutoSize 208 | Write-Host "::error::PSScriptAnalyzer found issues in PowerShell files" 209 | Write-Host "::endgroup::" 210 | exit 1 211 | } else { 212 | Write-Host "No issues found in PowerShell files" 213 | Write-Host "::endgroup::" 214 | } 215 | 216 | - name: Python - flake8 217 | if: always() 218 | run: | 219 | python -m flake8 \ 220 | --color=always \ 221 | --verbose 222 | 223 | - name: Python - nbqa flake8 224 | if: always() 225 | run: | 226 | python -m nbqa flake8 \ 227 | --color=always \ 228 | --verbose \ 229 | . 230 | 231 | - name: Python - nb-clean 232 | if: always() 233 | run: | 234 | output=$(find . -name '*.ipynb' -exec nb-clean check {} \;) 235 | 236 | # fail if there are any issues 237 | if [ -n "$output" ]; then 238 | echo "$output" 239 | exit 1 240 | fi 241 | 242 | - name: Rust - find Cargo.toml 243 | id: run_cargo 244 | if: always() 245 | run: | 246 | # check if Cargo.toml exists 247 | if [ -f "Cargo.toml" ]; then 248 | echo "found_cargo=true" >> $GITHUB_OUTPUT 249 | else 250 | echo "found_cargo=false" >> $GITHUB_OUTPUT 251 | fi 252 | 253 | - name: Rust - setup toolchain 254 | if: always() && steps.run_cargo.outputs.found_cargo == 'true' 255 | uses: dtolnay/rust-toolchain@stable 256 | with: 257 | components: rustfmt 258 | 259 | - name: Rust - cargo fmt 260 | if: always() && steps.run_cargo.outputs.found_cargo == 'true' 261 | run: | 262 | cargo fmt -- --check 263 | 264 | - name: YAML - find files 265 | id: yaml_files 266 | if: always() 267 | run: | 268 | # space separated list of files 269 | FILES=.clang-format 270 | 271 | # empty placeholder 272 | found_files="" 273 | 274 | for FILE in ${FILES}; do 275 | if [ -f "$FILE" ] 276 | then 277 | found_files="$found_files $FILE" 278 | fi 279 | done 280 | 281 | echo "found_files=${found_files}" >> $GITHUB_OUTPUT 282 | 283 | - name: YAML - yamllint 284 | id: yamllint 285 | if: always() 286 | uses: ibiqlik/action-yamllint@v3 287 | with: 288 | # https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration 289 | config_data: | 290 | extends: default 291 | rules: 292 | comments: 293 | level: error 294 | document-start: 295 | level: error 296 | line-length: 297 | max: 120 298 | new-line-at-end-of-file: 299 | level: error 300 | new-lines: 301 | type: unix 302 | truthy: 303 | # GitHub uses "on" for workflow event triggers 304 | # .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning" 305 | allowed-values: ['true', 'false', 'on'] 306 | check-keys: true 307 | level: warning 308 | file_or_dir: . ${{ steps.yaml_files.outputs.found_files }} 309 | 310 | - name: YAML - log 311 | if: always() && steps.yamllint.outcome == 'failure' 312 | run: cat "${{ steps.yamllint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY 313 | -------------------------------------------------------------------------------- /.github/workflows/issues.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This workflow is centrally managed in https://github.com//.github/ 3 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in 4 | # the above-mentioned repo. 5 | 6 | # Label and un-label actions using `../label-actions.yml`. 7 | 8 | name: Issues 9 | permissions: {} 10 | 11 | on: 12 | issues: 13 | types: 14 | - labeled 15 | - unlabeled 16 | discussion: 17 | types: 18 | - labeled 19 | - unlabeled 20 | 21 | jobs: 22 | label: 23 | name: Label Actions 24 | if: startsWith(github.repository, 'LizardByte/') 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Label Actions 28 | uses: dessant/label-actions@v4 29 | with: 30 | github-token: ${{ secrets.GH_BOT_TOKEN }} 31 | -------------------------------------------------------------------------------- /.github/workflows/update-db.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Update 3 | permissions: 4 | contents: read 5 | 6 | on: 7 | pull_request: 8 | branches: 9 | - master 10 | types: 11 | - opened 12 | - synchronize 13 | - reopened 14 | push: 15 | branches: 16 | - master 17 | schedule: 18 | - cron: '0 0 * * *' # every day at midnight 19 | workflow_dispatch: 20 | 21 | concurrency: 22 | group: "${{ github.workflow }}-${{ github.ref }}" 23 | cancel-in-progress: true 24 | 25 | jobs: 26 | update: 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout 30 | uses: actions/checkout@v4 31 | 32 | - name: Cache 33 | id: cache 34 | uses: actions/cache@v4 35 | with: 36 | path: cache 37 | key: update-${{ github.sha }} 38 | 39 | - name: Set up Python 40 | uses: actions/setup-python@v5 41 | with: 42 | python-version: '3.12' 43 | 44 | - name: Install Python dependencies 45 | run: | 46 | python -m pip install --upgrade pip 47 | python -m pip install -r requirements.txt 48 | 49 | - name: Update 50 | env: 51 | TWITCH_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }} 52 | TWITCH_CLIENT_SECRET: ${{ secrets.TWITCH_CLIENT_SECRET }} 53 | YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} 54 | run: python -u src/update_db.py ${{ github.event_name == 'pull_request' && '-t' || '' }} 55 | 56 | - name: Prepare Artifacts # uploading artifacts will fail if not zipped due to very large quantity of files 57 | shell: bash 58 | run: 7z a build.zip ./gh-pages/* ./gh-pages-template/* 59 | 60 | - name: Upload artifact 61 | uses: actions/upload-artifact@v4 62 | with: 63 | name: update 64 | path: ${{ github.workspace }}/build.zip 65 | if-no-files-found: error 66 | include-hidden-files: true 67 | retention-days: 1 68 | 69 | call-jekyll-build: 70 | needs: update 71 | uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master 72 | secrets: 73 | GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }} 74 | GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }} 75 | GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} 76 | with: 77 | site_artifact: 'update' 78 | extract_archive: 'build.zip' 79 | target_branch: 'gh-pages' 80 | clean_gh_pages: true 81 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/#use-with-ide 110 | .pdm.toml 111 | 112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 113 | __pypackages__/ 114 | 115 | # Celery stuff 116 | celerybeat-schedule 117 | celerybeat.pid 118 | 119 | # SageMath parsed files 120 | *.sage.py 121 | 122 | # Environments 123 | .env 124 | .venv 125 | env/ 126 | venv/ 127 | ENV/ 128 | env.bak/ 129 | venv.bak/ 130 | 131 | # Spyder project settings 132 | .spyderproject 133 | .spyproject 134 | 135 | # Rope project settings 136 | .ropeproject 137 | 138 | # mkdocs documentation 139 | /site 140 | 141 | # mypy 142 | .mypy_cache/ 143 | .dmypy.json 144 | dmypy.json 145 | 146 | # Pyre type checker 147 | .pyre/ 148 | 149 | # pytype static type analyzer 150 | .pytype/ 151 | 152 | # Cython debug symbols 153 | cython_debug/ 154 | 155 | # PyCharm 156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 158 | # and can be added to the global gitignore or merged into this file. For a more nuclear 159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 160 | .idea/ 161 | 162 | # Project specific 163 | gh-pages/ 164 | cache/ 165 | *.sqlite 166 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | version: 2 6 | 7 | build: 8 | os: ubuntu-24.04 9 | tools: 10 | ruby: "3.3" 11 | apt_packages: 12 | - 7zip 13 | - jq 14 | jobs: 15 | install: 16 | - | 17 | mkdir -p "./tmp" 18 | branch="master" 19 | base_url="https://raw.githubusercontent.com/LizardByte/LizardByte.github.io" 20 | url="${base_url}/refs/heads/${branch}/scripts/readthedocs_build.sh" 21 | curl -sSL -o "./tmp/readthedocs_build.sh" "${url}" 22 | chmod +x "./tmp/readthedocs_build.sh" 23 | build: 24 | html: 25 | - "./tmp/readthedocs_build.sh" 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GameDB 2 | 3 | [![GitHub Workflow Status (DB)](https://img.shields.io/github/actions/workflow/status/lizardbyte/gamedb/update-db.yml.svg?branch=master&label=update%20db&logo=github&style=for-the-badge)](https://github.com/LizardByte/GameDB/actions/workflows/update-db.yml?query=branch%3Amaster) 4 | 5 | This repository clones IGDB to gh-pages to be consumed by LizardByte projects, such as LizardByte/Sunshine. 6 | 7 | Information from YouTube API is also added to the database for videos. 8 | 9 | ## Plans 10 | 11 | - [x] Build with Jekyll 12 | - [ ] Revamp index page 13 | - [ ] Provide an item page for each API item 14 | - [ ] Add unit tests 15 | - [ ] Add code coverage 16 | -------------------------------------------------------------------------------- /gh-pages-template/assets/img/no-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LizardByte/GameDB/b914c2be3a32a8d079c7988914726eb5f331380e/gh-pages-template/assets/img/no-logo.png -------------------------------------------------------------------------------- /gh-pages-template/assets/js/item_loader.js: -------------------------------------------------------------------------------- 1 | // setup defaults 2 | let org_name = "LizardByte" 3 | let base_url = `https://app.${org_name.toLowerCase()}.dev/GameDB` 4 | 5 | // get search options, we will append each platform to this list 6 | let search_options = document.getElementById("search_type") 7 | 8 | // get platforms container 9 | let platforms_container = document.getElementById("platforms-container") 10 | 11 | 12 | $(document).ready(function(){ 13 | // Set cache = false for all jquery ajax requests. 14 | $.ajaxSetup({ 15 | cache: false, 16 | }) 17 | 18 | // get platform cross-reference from json 19 | let platform_xref 20 | let get_platform_xref = function() { 21 | $.ajax({ 22 | url: `${base_url}/platforms/cross-reference.json`, 23 | type: "GET", 24 | dataType: "json", 25 | async: false, // this is false, so we can set the platform_xref variable 26 | success: function (result) { 27 | platform_xref = result 28 | } 29 | }) 30 | } 31 | 32 | let platform_region_flag_map = { 33 | "europe": { 34 | "code": String.fromCodePoint(0x1F1EA, 0x1F1FA), 35 | "size": "fs-2", 36 | }, 37 | "north_america": { 38 | "code": String.fromCodePoint(0x1F1FA, 0x1F1F8), 39 | "size": "fs-2", 40 | }, 41 | "australia": { 42 | "code": String.fromCodePoint(0x1F1E6, 0x1F1FA), 43 | "size": "fs-2", 44 | }, 45 | "new_zealand": { 46 | "code": String.fromCodePoint(0x1F1F3, 0x1F1FF), 47 | "size": "fs-2", 48 | }, 49 | "japan": { 50 | "code": String.fromCodePoint(0x1F1EF, 0x1F1F5), 51 | "size": "fs-2", 52 | }, 53 | "china": { 54 | "code": String.fromCodePoint(0x1F1E8, 0x1F1F3), 55 | "size": "fs-2", 56 | }, 57 | "asia": { 58 | "code": String.fromCodePoint(0x1F30F), 59 | "size": "fs-4", 60 | }, 61 | "worldwide": { 62 | "code": String.fromCodePoint(0x1F30E), 63 | "size": "fs-4", 64 | }, 65 | "korea": { 66 | "code": String.fromCodePoint(0x1F1F0, 0x1F1F7), 67 | "size": "fs-2", 68 | }, 69 | "brazil": { 70 | "code": String.fromCodePoint(0x1F1E7, 0x1F1F7), 71 | "size": "fs-2", 72 | }, 73 | } 74 | 75 | let metadata_key_icon_map = { 76 | // material icons 77 | 'os': 'code_blocks', 78 | 'cpu': 'memory', 79 | 'graphics': 'developer_board', 80 | 'memory': 'memory_alt', 81 | 'storage': 'storage', 82 | 'media': 'save', 83 | 'connectivity': 'cable', 84 | 'output': 'settings_input_component', 85 | 'resolutions': 'aspect_ratio', 86 | 'sound': 'volume_up', 87 | // these will be processed slightly differently 88 | 'platform_version_release_dates': null, 89 | 'summary': null, 90 | } 91 | 92 | let splitString = function(string) { 93 | if (string === undefined) { 94 | return [undefined]; 95 | } 96 | 97 | // Ensure the string is longer than 500 characters 98 | if (string.length > 500) { 99 | // Find the last full word prior to the 500th character using regex 100 | const regex = /(.{0,500})\b/; 101 | const match = regex.exec(string); 102 | 103 | if (match) { 104 | // Split the string at the end of the last full word 105 | const splitIndex = match[1].length; 106 | const firstPart = string.slice(0, splitIndex); 107 | 108 | return [firstPart, string]; 109 | } 110 | } 111 | 112 | // Return the string as is if it's shorter than 500 characters 113 | return [string]; 114 | } 115 | 116 | // create platform cards 117 | let initialize = function(){ 118 | $.ajax({ 119 | url: `${base_url}/platforms/all.json`, 120 | type: "GET", 121 | dataType:"json", 122 | success: function (result) { 123 | let platforms = [] 124 | for (let platform in result) { 125 | 126 | // add screenscraper id to platform, start with null value 127 | result[platform]['screenscraper_id'] = null 128 | result[platform]['screenscraper_region'] = null 129 | 130 | for (let xref in platform_xref) { 131 | if (platform_xref[xref]['ids']['igdb'] === result[platform]['id']) { 132 | result[platform]['screenscraper_id'] = platform_xref[xref]['ids']['screenscraper'] 133 | result[platform]['screenscraper_region'] = platform_xref[xref]['variables']['screenscraper']['region'] 134 | } 135 | } 136 | 137 | platforms.push(result[platform]) 138 | } 139 | 140 | let sorted = platforms.sort(window.rankingSorter("name", "id")).reverse() 141 | 142 | for(let item in sorted) { 143 | // create search option 144 | let search_option = document.createElement("option") 145 | search_option.value = sorted[item]['id'] 146 | search_option.textContent = sorted[item]['name'] 147 | search_options.appendChild(search_option) 148 | 149 | let column = document.createElement("div") 150 | column.className = "col-lg-4 mb-5" 151 | platforms_container.appendChild(column) 152 | 153 | let card = document.createElement("div") 154 | card.className = "card h-100 shadow border-0 rounded-0" 155 | column.appendChild(card) 156 | 157 | let banner_div = document.createElement("div") 158 | banner_div.className = "hover-zoom" 159 | card.append(banner_div) 160 | 161 | let banner_link = document.createElement("a") 162 | banner_link.href = sorted[item]['url'] 163 | banner_link.target = "_blank" 164 | banner_div.append(banner_link) 165 | 166 | let banner = document.createElement("img") 167 | banner.className = "card-img-top rounded-0" 168 | 169 | // see if screensraper id has an image 170 | if (sorted[item]['screenscraper_id'] !== null && sorted[item]['screenscraper_region'] !== null) { 171 | banner.src = `https://screenscraper.fr/image.php?plateformid=${sorted[item]['screenscraper_id']}&media=wheel®ion=${sorted[item]['screenscraper_region']}&num=&version=&maxwidth=600&maxheight=600` 172 | banner.classList.add("bg-dark") 173 | banner.classList.add("bg-gradient") 174 | banner.classList.add("p-4") 175 | } 176 | else { 177 | try { 178 | banner.src = sorted[item]['platform_logo']['url'].replace("t_thumb", "t_cover_big") 179 | } 180 | catch (err) { 181 | banner.src = "/GameDB/assets/img/no-logo.png" 182 | banner.classList.add("bg-dark") 183 | banner.classList.add("bg-gradient") 184 | banner.classList.add("p-4") 185 | banner_div.classList.remove("hover-zoom") 186 | } 187 | } 188 | banner.alt = "" 189 | banner_link.append(banner) 190 | 191 | let card_body = document.createElement("div") 192 | card_body.className = "card-body text-white p-4 rounded-0" 193 | card.appendChild(card_body) 194 | 195 | let card_title_link = document.createElement("a") 196 | card_title_link.className = "text-decoration-none link-light" 197 | card_title_link.href = sorted[item]['url'] 198 | card_title_link.target = "_blank" 199 | card_body.appendChild(card_title_link) 200 | 201 | let card_title_text = document.createElement("h5") 202 | card_title_text.className = "card-title mb-3 fw-bolder" 203 | card_title_text.textContent = sorted[item]['name'] 204 | card_title_link.appendChild(card_title_text) 205 | 206 | let summary = splitString(sorted[item]['summary']) 207 | 208 | let card_paragraph_div = document.createElement("div") 209 | card_paragraph_div.className = "mb-3" 210 | card_body.appendChild(card_paragraph_div) 211 | 212 | let card_paragraph = document.createElement("p") 213 | card_paragraph.className = "card-text mb-0" 214 | card_paragraph.textContent = summary[0] 215 | card_paragraph_div.appendChild(card_paragraph) 216 | 217 | let card_footer = document.createElement("div") 218 | card_footer.className = "card-footer p-2 pt-0 border-0 rounded-0" 219 | card.appendChild(card_footer) 220 | 221 | // get first or last version depending on "category" 222 | let version 223 | if (sorted[item]['category'] === 4) { 224 | // this is an operating system, so get the last version (hopefully newest) 225 | version = sorted[item]['versions'][sorted[item]['versions'].length - 1] 226 | } 227 | else { 228 | // this is a console/pc/etc., so get the first version (initial version) 229 | version = sorted[item]['versions'][0] 230 | } 231 | 232 | for (let key in metadata_key_icon_map) { 233 | if (version[key] !== undefined) { 234 | // process summary first 235 | if (key === 'summary') { 236 | if (sorted[item]['summary'] === undefined) { 237 | summary = splitString(version[key]) 238 | card_paragraph.textContent = summary[0] 239 | } 240 | } 241 | else { 242 | // create div for metadata 243 | let metadata_div = document.createElement("div") 244 | metadata_div.className = "ms-4 mb-2" 245 | 246 | if (key === 'platform_version_release_dates') { 247 | // get the region and release date for each release date 248 | for (let release_date in version[key]) { 249 | // create div container for each release date 250 | let release_date_div = document.createElement("div") 251 | release_date_div.className = "d-flex align-items-center" 252 | metadata_div.appendChild(release_date_div) 253 | 254 | // show flag emoji as prefix 255 | let regionName = version[key][release_date]['release_region']['region'] 256 | let flag_prefix = document.createElement("span") 257 | flag_prefix.className = `${platform_region_flag_map[regionName]['size']} me-3 text-center` 258 | flag_prefix.textContent = platform_region_flag_map[regionName]['code'] 259 | flag_prefix.title = regionName.replace("_", " ") 260 | release_date_div.appendChild(flag_prefix) 261 | 262 | // add date 263 | let date = document.createElement("span") 264 | date.textContent = version[key][release_date]['human'] 265 | release_date_div.appendChild(date) 266 | } 267 | } 268 | else { 269 | let key_div = document.createElement("div") 270 | key_div.className = "d-flex align-items-center" 271 | metadata_div.appendChild(key_div) 272 | 273 | // add key symbol as prefix 274 | let key_prefix = document.createElement("span") 275 | key_prefix.className = "material-symbols-outlined fs-2 me-3 text-center" 276 | key_prefix.textContent = metadata_key_icon_map[key] 277 | key_prefix.title = key.replace("_", " ") 278 | key_div.appendChild(key_prefix) 279 | 280 | // add value 281 | let key_value = document.createElement("span") 282 | key_value.textContent = version[key] 283 | key_div.appendChild(key_value) 284 | } 285 | 286 | // add metadata div to footer 287 | card_body.appendChild(metadata_div) 288 | } 289 | } 290 | } 291 | 292 | if (summary.length > 1) { 293 | // create a see more "action/link" 294 | let see_more = document.createElement("a") 295 | 296 | // create a see less "action/link" 297 | let see_less = document.createElement("a") 298 | 299 | // populate see more/less links 300 | see_more.className = "link-light" 301 | see_more.onclick = function() { 302 | card_paragraph.textContent = summary[1] 303 | see_more.classList.add("d-none") 304 | see_less.classList.remove("d-none") 305 | } 306 | see_more.textContent = "See more" 307 | card_paragraph_div.appendChild(see_more) 308 | 309 | see_less.className = "link-light d-none" 310 | see_less.onclick = function() { 311 | card_paragraph.textContent = summary[0] 312 | see_less.classList.add("d-none") 313 | see_more.classList.remove("d-none") 314 | } 315 | see_less.textContent = "See less" 316 | card_paragraph_div.appendChild(see_less) 317 | } 318 | } 319 | } 320 | }) 321 | } 322 | 323 | get_platform_xref() 324 | initialize() 325 | }) 326 | -------------------------------------------------------------------------------- /gh-pages-template/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | title: GameDB 3 | layout: page 4 | full-width: true 5 | after-content: 6 | - donate.html 7 | - support.html 8 | 9 | # TODO: Add `cover-img` (supports multiple) 10 | 11 | ext-css: 12 | - href: https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200 13 | ext-js: 14 | - https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js 15 | - https://cdn.jsdelivr.net/npm/@lizardbyte/shared-web@2024.921.191855/dist/levenshtein-distance.js 16 | - https://cdn.jsdelivr.net/npm/@lizardbyte/shared-web@2024.921.191855/dist/ranking-sorter.js 17 | js: 18 | - /GameDB/assets/js/item_loader.js 19 | --- 20 | 21 |
22 |
23 | 24 | 25 | 43 | 44 | 45 |
46 |
47 |
48 |
49 |

Platforms

50 |
51 |
52 |
53 |
54 |
55 | 56 |
57 |
58 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | flake8==7.2.0 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | igdb-api-v4==0.3.3 2 | python-dotenv==1.1.0 3 | requests==2.32.3 4 | requests-cache==1.2.1 5 | -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LizardByte/GameDB/b914c2be3a32a8d079c7988914726eb5f331380e/src/__init__.py -------------------------------------------------------------------------------- /src/platforms.py: -------------------------------------------------------------------------------- 1 | # this cross-reference is used to map the platform ids from IGDB to the platform ids from Screenscraper 2 | # the ids are manually mapped and will need to be updated periodically, i.e. when new platforms are added 3 | # the name is the name from IGDB, and is for reference only 4 | cross_reference = [ 5 | { 6 | "ids": { 7 | "igdb": 3, 8 | "screenscraper": 145, 9 | }, 10 | "name": "Linux", 11 | "variables": { 12 | "screenscraper": { 13 | "region": "wor", 14 | }, 15 | }, 16 | }, 17 | { 18 | "ids": { 19 | "igdb": 4, 20 | "screenscraper": 14, 21 | }, 22 | "name": "Nintendo 64", 23 | "variables": { 24 | "screenscraper": { 25 | "region": "wor", 26 | }, 27 | }, 28 | }, 29 | { 30 | "ids": { 31 | "igdb": 5, 32 | "screenscraper": 16, 33 | }, 34 | "name": "Wii", 35 | "variables": { 36 | "screenscraper": { 37 | "region": "wor", 38 | }, 39 | }, 40 | }, 41 | { 42 | "ids": { 43 | "igdb": 6, 44 | "screenscraper": 138, 45 | }, 46 | "name": "PC (Microsoft Windows)", 47 | "variables": { 48 | "screenscraper": { 49 | "region": "wor", 50 | }, 51 | }, 52 | }, 53 | { 54 | "ids": { 55 | "igdb": 7, 56 | "screenscraper": 57, 57 | }, 58 | "name": "PlayStation", 59 | "variables": { 60 | "screenscraper": { 61 | "region": "wor", 62 | }, 63 | }, 64 | }, 65 | { 66 | "ids": { 67 | "igdb": 8, 68 | "screenscraper": 58, 69 | }, 70 | "name": "PlayStation 2", 71 | "variables": { 72 | "screenscraper": { 73 | "region": "wor", 74 | }, 75 | }, 76 | }, 77 | { 78 | "ids": { 79 | "igdb": 9, 80 | "screenscraper": 59, 81 | }, 82 | "name": "PlayStation 3", 83 | "variables": { 84 | "screenscraper": { 85 | "region": "wor", 86 | }, 87 | }, 88 | }, 89 | { 90 | "ids": { 91 | "igdb": 11, 92 | "screenscraper": 32, 93 | }, 94 | "name": "Xbox", 95 | "variables": { 96 | "screenscraper": { 97 | "region": "wor", 98 | }, 99 | }, 100 | }, 101 | { 102 | "ids": { 103 | "igdb": 12, 104 | "screenscraper": 33, 105 | }, 106 | "name": "Xbox 360", 107 | "variables": { 108 | "screenscraper": { 109 | "region": "wor", 110 | }, 111 | }, 112 | }, 113 | { 114 | "ids": { 115 | "igdb": 13, 116 | "screenscraper": 135, 117 | }, 118 | "name": "DOS", 119 | "variables": { 120 | "screenscraper": { 121 | "region": "wor", 122 | }, 123 | }, 124 | }, 125 | { 126 | "ids": { 127 | "igdb": 14, 128 | "screenscraper": 146, 129 | }, 130 | "name": "Mac", 131 | "variables": { 132 | "screenscraper": { 133 | "region": "wor", 134 | }, 135 | }, 136 | }, 137 | { 138 | "ids": { 139 | "igdb": 15, 140 | "screenscraper": 66, 141 | }, 142 | "name": "Commodore C64/128/MAX", 143 | "variables": { 144 | "screenscraper": { 145 | "region": "wor", 146 | }, 147 | }, 148 | }, 149 | { 150 | "ids": { 151 | "igdb": 16, 152 | "screenscraper": 64, 153 | }, 154 | "name": "Amiga", 155 | "variables": { 156 | "screenscraper": { 157 | "region": "wor", 158 | }, 159 | }, 160 | }, 161 | { 162 | "ids": { 163 | "igdb": 18, 164 | "screenscraper": 3, 165 | }, 166 | "name": "Nintendo Entertainment System", 167 | "variables": { 168 | "screenscraper": { 169 | "region": "wor", 170 | }, 171 | }, 172 | }, 173 | { 174 | "ids": { 175 | "igdb": 19, 176 | "screenscraper": 4, 177 | }, 178 | "name": "Super Nintendo Entertainment System", 179 | "variables": { 180 | "screenscraper": { 181 | "region": "wor", 182 | }, 183 | }, 184 | }, 185 | { 186 | "ids": { 187 | "igdb": 20, 188 | "screenscraper": 15, 189 | }, 190 | "name": "Nintendo DS", 191 | "variables": { 192 | "screenscraper": { 193 | "region": "wor", 194 | }, 195 | }, 196 | }, 197 | { 198 | "ids": { 199 | "igdb": 21, 200 | "screenscraper": 13, 201 | }, 202 | "name": "Nintendo GameCube", 203 | "variables": { 204 | "screenscraper": { 205 | "region": "wor", 206 | }, 207 | }, 208 | }, 209 | { 210 | "ids": { 211 | "igdb": 22, 212 | "screenscraper": 10, 213 | }, 214 | "name": "Game Boy Color", 215 | "variables": { 216 | "screenscraper": { 217 | "region": "wor", 218 | }, 219 | }, 220 | }, 221 | { 222 | "ids": { 223 | "igdb": 23, 224 | "screenscraper": 23, 225 | }, 226 | "name": "Dreamcast", 227 | "variables": { 228 | "screenscraper": { 229 | "region": "wor", 230 | }, 231 | }, 232 | }, 233 | { 234 | "ids": { 235 | "igdb": 24, 236 | "screenscraper": 12, 237 | }, 238 | "name": "Game Boy Advance", 239 | "variables": { 240 | "screenscraper": { 241 | "region": "wor", 242 | }, 243 | }, 244 | }, 245 | { 246 | "ids": { 247 | "igdb": 25, 248 | "screenscraper": 65, 249 | }, 250 | "name": "Amstrad CPC", 251 | "variables": { 252 | "screenscraper": { 253 | "region": "wor", 254 | }, 255 | }, 256 | }, 257 | { 258 | "ids": { 259 | "igdb": 26, 260 | "screenscraper": 76, 261 | }, 262 | "name": "ZX Spectrum", 263 | "variables": { 264 | "screenscraper": { 265 | "region": "wor", 266 | }, 267 | }, 268 | }, 269 | { 270 | "ids": { 271 | "igdb": 27, 272 | "screenscraper": 113, 273 | }, 274 | "name": "MSX", 275 | "variables": { 276 | "screenscraper": { 277 | "region": "wor", 278 | }, 279 | }, 280 | }, 281 | { 282 | "ids": { 283 | "igdb": 29, 284 | "screenscraper": 1, 285 | }, 286 | "name": "Sega Mega Drive/Genesis", 287 | "variables": { 288 | "screenscraper": { 289 | "region": "wor", 290 | }, 291 | }, 292 | }, 293 | { 294 | "ids": { 295 | "igdb": 30, 296 | "screenscraper": 19, 297 | }, 298 | "name": "Sega 32X", 299 | "variables": { 300 | "screenscraper": { 301 | "region": "wor", 302 | }, 303 | }, 304 | }, 305 | { 306 | "ids": { 307 | "igdb": 32, 308 | "screenscraper": 22, 309 | }, 310 | "name": "Sega Saturn", 311 | "variables": { 312 | "screenscraper": { 313 | "region": "wor", 314 | }, 315 | }, 316 | }, 317 | { 318 | "ids": { 319 | "igdb": 33, 320 | "screenscraper": 9, 321 | }, 322 | "name": "Game Boy", 323 | "variables": { 324 | "screenscraper": { 325 | "region": "wor", 326 | }, 327 | }, 328 | }, 329 | { 330 | "ids": { 331 | "igdb": 34, 332 | "screenscraper": 63, 333 | }, 334 | "name": "Android", 335 | "variables": { 336 | "screenscraper": { 337 | "region": "wor", 338 | }, 339 | }, 340 | }, 341 | { 342 | "ids": { 343 | "igdb": 35, 344 | "screenscraper": 21, 345 | }, 346 | "name": "Sega Game Gear", 347 | "variables": { 348 | "screenscraper": { 349 | "region": "wor", 350 | }, 351 | }, 352 | }, 353 | { 354 | "ids": { 355 | "igdb": 37, 356 | "screenscraper": 17, 357 | }, 358 | "name": "Nintendo 3DS", 359 | "variables": { 360 | "screenscraper": { 361 | "region": "wor", 362 | }, 363 | }, 364 | }, 365 | { 366 | "ids": { 367 | "igdb": 38, 368 | "screenscraper": 61, 369 | }, 370 | "name": "PlayStation Portable", 371 | "variables": { 372 | "screenscraper": { 373 | "region": "wor", 374 | }, 375 | }, 376 | }, 377 | { 378 | "ids": { 379 | "igdb": 39, 380 | "screenscraper": None, 381 | }, 382 | "name": "iOS", 383 | "variables": { 384 | "screenscraper": { 385 | "region": None, 386 | }, 387 | }, 388 | }, 389 | { 390 | "ids": { 391 | "igdb": 41, 392 | "screenscraper": 18, 393 | }, 394 | "name": "Wii U", 395 | "variables": { 396 | "screenscraper": { 397 | "region": "wor", 398 | }, 399 | }, 400 | }, 401 | { 402 | "ids": { 403 | "igdb": 42, 404 | "screenscraper": 30, 405 | }, 406 | "name": "N-Gage", 407 | "variables": { 408 | "screenscraper": { 409 | "region": "wor", 410 | }, 411 | }, 412 | }, 413 | { 414 | "ids": { 415 | "igdb": 44, 416 | "screenscraper": None, 417 | }, 418 | "name": "Tapwave Zodiac", 419 | "variables": { 420 | "screenscraper": { 421 | "region": None, 422 | }, 423 | }, 424 | }, 425 | { 426 | "ids": { 427 | "igdb": 46, 428 | "screenscraper": 62, 429 | }, 430 | "name": "PlayStation Vita", 431 | "variables": { 432 | "screenscraper": { 433 | "region": "wor", 434 | }, 435 | }, 436 | }, 437 | { 438 | "ids": { 439 | "igdb": 47, 440 | "screenscraper": None, 441 | }, 442 | "name": "Virtual Console", 443 | "variables": { 444 | "screenscraper": { 445 | "region": None, 446 | }, 447 | }, 448 | }, 449 | { 450 | "ids": { 451 | "igdb": 48, 452 | "screenscraper": 60, 453 | }, 454 | "name": "PlayStation 4", 455 | "variables": { 456 | "screenscraper": { 457 | "region": "wor", 458 | }, 459 | }, 460 | }, 461 | { 462 | "ids": { 463 | "igdb": 49, 464 | "screenscraper": 34, 465 | }, 466 | "name": "Xbox One", 467 | "variables": { 468 | "screenscraper": { 469 | "region": "wor", 470 | }, 471 | }, 472 | }, 473 | { 474 | "ids": { 475 | "igdb": 50, 476 | "screenscraper": 29, 477 | }, 478 | "name": "3DO Interactive Multiplayer", 479 | "variables": { 480 | "screenscraper": { 481 | "region": "wor", 482 | }, 483 | }, 484 | }, 485 | { 486 | "ids": { 487 | "igdb": 51, 488 | "screenscraper": 106, 489 | }, 490 | "name": "Family Computer Disk System", 491 | "variables": { 492 | "screenscraper": { 493 | "region": "wor", 494 | }, 495 | }, 496 | }, 497 | { 498 | "ids": { 499 | "igdb": 52, 500 | "screenscraper": None, 501 | }, 502 | "name": "Arcade", 503 | "variables": { 504 | "screenscraper": { 505 | "region": None, 506 | }, 507 | }, 508 | }, 509 | { 510 | "ids": { 511 | "igdb": 53, 512 | "screenscraper": 116, 513 | }, 514 | "name": "MSX2", 515 | "variables": { 516 | "screenscraper": { 517 | "region": "wor", 518 | }, 519 | }, 520 | }, 521 | { 522 | "ids": { 523 | "igdb": 55, 524 | "screenscraper": None, 525 | }, 526 | "name": "Legacy Mobile Device", 527 | "variables": { 528 | "screenscraper": { 529 | "region": None, 530 | }, 531 | }, 532 | }, 533 | { 534 | "ids": { 535 | "igdb": 57, 536 | "screenscraper": 45, 537 | }, 538 | "name": "WonderSwan", 539 | "variables": { 540 | "screenscraper": { 541 | "region": "wor", 542 | }, 543 | }, 544 | }, 545 | { 546 | "ids": { 547 | "igdb": 58, 548 | "screenscraper": 4, 549 | }, 550 | "name": "Super Famicom", 551 | "variables": { 552 | "screenscraper": { 553 | "region": "jp", 554 | }, 555 | }, 556 | }, 557 | { 558 | "ids": { 559 | "igdb": 59, 560 | "screenscraper": 26, 561 | }, 562 | "name": "Atari 2600", 563 | "variables": { 564 | "screenscraper": { 565 | "region": "wor", 566 | }, 567 | }, 568 | }, 569 | { 570 | "ids": { 571 | "igdb": 60, 572 | "screenscraper": 41, 573 | }, 574 | "name": "Atari 7800", 575 | "variables": { 576 | "screenscraper": { 577 | "region": "wor", 578 | }, 579 | }, 580 | }, 581 | { 582 | "ids": { 583 | "igdb": 61, 584 | "screenscraper": 28, 585 | }, 586 | "name": "Atari Lynx", 587 | "variables": { 588 | "screenscraper": { 589 | "region": "wor", 590 | }, 591 | }, 592 | }, 593 | { 594 | "ids": { 595 | "igdb": 62, 596 | "screenscraper": 27, 597 | }, 598 | "name": "Atari Jaguar", 599 | "variables": { 600 | "screenscraper": { 601 | "region": "wor", 602 | }, 603 | }, 604 | }, 605 | { 606 | "ids": { 607 | "igdb": 63, 608 | "screenscraper": 42, 609 | }, 610 | "name": "Atari ST/STE", 611 | "variables": { 612 | "screenscraper": { 613 | "region": "wor", 614 | }, 615 | }, 616 | }, 617 | { 618 | "ids": { 619 | "igdb": 64, 620 | "screenscraper": 2, 621 | }, 622 | "name": "Sega Master System/Mark III", 623 | "variables": { 624 | "screenscraper": { 625 | "region": "wor", 626 | }, 627 | }, 628 | }, 629 | { 630 | "ids": { 631 | "igdb": 65, 632 | "screenscraper": 43, 633 | }, 634 | "name": "Atari 8-bit", 635 | "variables": { 636 | "screenscraper": { 637 | "region": "wor", 638 | }, 639 | }, 640 | }, 641 | { 642 | "ids": { 643 | "igdb": 66, 644 | "screenscraper": 40, 645 | }, 646 | "name": "Atari 5200", 647 | "variables": { 648 | "screenscraper": { 649 | "region": "wor", 650 | }, 651 | }, 652 | }, 653 | { 654 | "ids": { 655 | "igdb": 67, 656 | "screenscraper": None, 657 | }, 658 | "name": "Intellivision", 659 | "variables": { 660 | "screenscraper": { 661 | "region": None, 662 | }, 663 | }, 664 | }, 665 | { 666 | "ids": { 667 | "igdb": 68, 668 | "screenscraper": 48, 669 | }, 670 | "name": "ColecoVision", 671 | "variables": { 672 | "screenscraper": { 673 | "region": "wor", 674 | }, 675 | }, 676 | }, 677 | { 678 | "ids": { 679 | "igdb": 69, 680 | "screenscraper": 37, 681 | }, 682 | "name": "BBC Microcomputer System", 683 | "variables": { 684 | "screenscraper": { 685 | "region": "wor", 686 | }, 687 | }, 688 | }, 689 | { 690 | "ids": { 691 | "igdb": 70, 692 | "screenscraper": 102, 693 | }, 694 | "name": "Vectrex", 695 | "variables": { 696 | "screenscraper": { 697 | "region": "wor", 698 | }, 699 | }, 700 | }, 701 | { 702 | "ids": { 703 | "igdb": 71, 704 | "screenscraper": 73, 705 | }, 706 | "name": "Commodore VIC-20", 707 | "variables": { 708 | "screenscraper": { 709 | "region": "wor", 710 | }, 711 | }, 712 | }, 713 | { 714 | "ids": { 715 | "igdb": 72, 716 | "screenscraper": None, 717 | }, 718 | "name": "Ouya", 719 | "variables": { 720 | "screenscraper": { 721 | "region": None, 722 | }, 723 | }, 724 | }, 725 | { 726 | "ids": { 727 | "igdb": 73, 728 | "screenscraper": None, 729 | }, 730 | "name": "BlackBerry OS", 731 | "variables": { 732 | "screenscraper": { 733 | "region": None, 734 | }, 735 | }, 736 | }, 737 | { 738 | "ids": { 739 | "igdb": 74, 740 | "screenscraper": None, 741 | }, 742 | "name": "Windows Phone", 743 | "variables": { 744 | "screenscraper": { 745 | "region": None, 746 | }, 747 | }, 748 | }, 749 | { 750 | "ids": { 751 | "igdb": 75, 752 | "screenscraper": 86, 753 | }, 754 | "name": "Apple II", 755 | "variables": { 756 | "screenscraper": { 757 | "region": "wor", 758 | }, 759 | }, 760 | }, 761 | { 762 | "ids": { 763 | "igdb": 77, 764 | "screenscraper": 220, 765 | }, 766 | "name": "Sharp X1", 767 | "variables": { 768 | "screenscraper": { 769 | "region": "wor", 770 | }, 771 | }, 772 | }, 773 | { 774 | "ids": { 775 | "igdb": 78, 776 | "screenscraper": 20, 777 | }, 778 | "name": "Sega CD", 779 | "variables": { 780 | "screenscraper": { 781 | "region": "wor", 782 | }, 783 | }, 784 | }, 785 | { 786 | "ids": { 787 | "igdb": 79, 788 | "screenscraper": 142, 789 | }, 790 | "name": "Neo Geo MVS", 791 | "variables": { 792 | "screenscraper": { 793 | "region": "wor", 794 | }, 795 | }, 796 | }, 797 | { 798 | "ids": { 799 | "igdb": 80, 800 | "screenscraper": 68, 801 | }, 802 | "name": "Neo Geo AES", 803 | "variables": { 804 | "screenscraper": { 805 | "region": "wor", 806 | }, 807 | }, 808 | }, 809 | { 810 | "ids": { 811 | "igdb": 82, 812 | "screenscraper": None, 813 | }, 814 | "name": "Web browser", 815 | "variables": { 816 | "screenscraper": { 817 | "region": None, 818 | }, 819 | }, 820 | }, 821 | { 822 | "ids": { 823 | "igdb": 84, 824 | "screenscraper": 109, 825 | }, 826 | "name": "SG-1000", 827 | "variables": { 828 | "screenscraper": { 829 | "region": "wor", 830 | }, 831 | }, 832 | }, 833 | { 834 | "ids": { 835 | "igdb": 85, 836 | "screenscraper": None, 837 | }, 838 | "name": "Donner Model 30", 839 | "variables": { 840 | "screenscraper": { 841 | "region": None, 842 | }, 843 | }, 844 | }, 845 | { 846 | "ids": { 847 | "igdb": 86, 848 | "screenscraper": 31, 849 | }, 850 | "name": "TurboGrafx-16/PC Engine", 851 | "variables": { 852 | "screenscraper": { 853 | "region": "wor", 854 | }, 855 | }, 856 | }, 857 | { 858 | "ids": { 859 | "igdb": 87, 860 | "screenscraper": 11, 861 | }, 862 | "name": "Virtual Boy", 863 | "variables": { 864 | "screenscraper": { 865 | "region": "wor", 866 | }, 867 | }, 868 | }, 869 | { 870 | "ids": { 871 | "igdb": 88, 872 | "screenscraper": None, 873 | }, 874 | "name": "Odyssey", 875 | "variables": { 876 | "screenscraper": { 877 | "region": None, 878 | }, 879 | }, 880 | }, 881 | { 882 | "ids": { 883 | "igdb": 89, 884 | "screenscraper": None, 885 | }, 886 | "name": "Microvision", 887 | "variables": { 888 | "screenscraper": { 889 | "region": None, 890 | }, 891 | }, 892 | }, 893 | { 894 | "ids": { 895 | "igdb": 90, 896 | "screenscraper": 240, 897 | }, 898 | "name": "Commodore PET", 899 | "variables": { 900 | "screenscraper": { 901 | "region": "wor", 902 | }, 903 | }, 904 | }, 905 | { 906 | "ids": { 907 | "igdb": 91, 908 | "screenscraper": 44, 909 | }, 910 | "name": "Bally Astrocade", 911 | "variables": { 912 | "screenscraper": { 913 | "region": "wor", 914 | }, 915 | }, 916 | }, 917 | { 918 | "ids": { 919 | "igdb": 93, 920 | "screenscraper": None, 921 | }, 922 | "name": "Commodore 16", 923 | "variables": { 924 | "screenscraper": { 925 | "region": None, 926 | }, 927 | }, 928 | }, 929 | { 930 | "ids": { 931 | "igdb": 94, 932 | "screenscraper": 99, 933 | }, 934 | "name": "Commodore Plus/4", 935 | "variables": { 936 | "screenscraper": { 937 | "region": "wor", 938 | }, 939 | }, 940 | }, 941 | { 942 | "ids": { 943 | "igdb": 95, 944 | "screenscraper": None, 945 | }, 946 | "name": "PDP-1", 947 | "variables": { 948 | "screenscraper": { 949 | "region": None, 950 | }, 951 | }, 952 | }, 953 | { 954 | "ids": { 955 | "igdb": 96, 956 | "screenscraper": None, 957 | }, 958 | "name": "PDP-10", 959 | "variables": { 960 | "screenscraper": { 961 | "region": None, 962 | }, 963 | }, 964 | }, 965 | { 966 | "ids": { 967 | "igdb": 97, 968 | "screenscraper": None, 969 | }, 970 | "name": "PDP-8", 971 | "variables": { 972 | "screenscraper": { 973 | "region": None, 974 | }, 975 | }, 976 | }, 977 | { 978 | "ids": { 979 | "igdb": 98, 980 | "screenscraper": None, 981 | }, 982 | "name": "DEC GT40", 983 | "variables": { 984 | "screenscraper": { 985 | "region": None, 986 | }, 987 | }, 988 | }, 989 | { 990 | "ids": { 991 | "igdb": 99, 992 | "screenscraper": 3, 993 | }, 994 | "name": "Family Computer", 995 | "variables": { 996 | "screenscraper": { 997 | "region": "jp", 998 | }, 999 | }, 1000 | }, 1001 | { 1002 | "ids": { 1003 | "igdb": 100, 1004 | "screenscraper": None, 1005 | }, 1006 | "name": "Analogue electronics", 1007 | "variables": { 1008 | "screenscraper": { 1009 | "region": None, 1010 | }, 1011 | }, 1012 | }, 1013 | { 1014 | "ids": { 1015 | "igdb": 101, 1016 | "screenscraper": None, 1017 | }, 1018 | "name": "Ferranti Nimrod Computer", 1019 | "variables": { 1020 | "screenscraper": { 1021 | "region": None, 1022 | }, 1023 | }, 1024 | }, 1025 | { 1026 | "ids": { 1027 | "igdb": 102, 1028 | "screenscraper": None, 1029 | }, 1030 | "name": "EDSAC", 1031 | "variables": { 1032 | "screenscraper": { 1033 | "region": None, 1034 | }, 1035 | }, 1036 | }, 1037 | { 1038 | "ids": { 1039 | "igdb": 103, 1040 | "screenscraper": None, 1041 | }, 1042 | "name": "PDP-7", 1043 | "variables": { 1044 | "screenscraper": { 1045 | "region": None, 1046 | }, 1047 | }, 1048 | }, 1049 | { 1050 | "ids": { 1051 | "igdb": 104, 1052 | "screenscraper": None, 1053 | }, 1054 | "name": "HP 2100", 1055 | "variables": { 1056 | "screenscraper": { 1057 | "region": None, 1058 | }, 1059 | }, 1060 | }, 1061 | { 1062 | "ids": { 1063 | "igdb": 105, 1064 | "screenscraper": None, 1065 | }, 1066 | "name": "HP 3000", 1067 | "variables": { 1068 | "screenscraper": { 1069 | "region": None, 1070 | }, 1071 | }, 1072 | }, 1073 | { 1074 | "ids": { 1075 | "igdb": 106, 1076 | "screenscraper": None, 1077 | }, 1078 | "name": "SDS Sigma 7", 1079 | "variables": { 1080 | "screenscraper": { 1081 | "region": None, 1082 | }, 1083 | }, 1084 | }, 1085 | { 1086 | "ids": { 1087 | "igdb": 107, 1088 | "screenscraper": None, 1089 | }, 1090 | "name": "Call-A-Computer time-shared mainframe computer system", 1091 | "variables": { 1092 | "screenscraper": { 1093 | "region": None, 1094 | }, 1095 | }, 1096 | }, 1097 | { 1098 | "ids": { 1099 | "igdb": 108, 1100 | "screenscraper": None, 1101 | }, 1102 | "name": "PDP-11", 1103 | "variables": { 1104 | "screenscraper": { 1105 | "region": None, 1106 | }, 1107 | }, 1108 | }, 1109 | { 1110 | "ids": { 1111 | "igdb": 109, 1112 | "screenscraper": None, 1113 | }, 1114 | "name": "CDC Cyber 70", 1115 | "variables": { 1116 | "screenscraper": { 1117 | "region": None, 1118 | }, 1119 | }, 1120 | }, 1121 | { 1122 | "ids": { 1123 | "igdb": 110, 1124 | "screenscraper": None, 1125 | }, 1126 | "name": "PLATO", 1127 | "variables": { 1128 | "screenscraper": { 1129 | "region": None, 1130 | }, 1131 | }, 1132 | }, 1133 | { 1134 | "ids": { 1135 | "igdb": 111, 1136 | "screenscraper": None, 1137 | }, 1138 | "name": "Imlac PDS-1", 1139 | "variables": { 1140 | "screenscraper": { 1141 | "region": None, 1142 | }, 1143 | }, 1144 | }, 1145 | { 1146 | "ids": { 1147 | "igdb": 112, 1148 | "screenscraper": None, 1149 | }, 1150 | "name": "Microcomputer", 1151 | "variables": { 1152 | "screenscraper": { 1153 | "region": None, 1154 | }, 1155 | }, 1156 | }, 1157 | { 1158 | "ids": { 1159 | "igdb": 113, 1160 | "screenscraper": None, 1161 | }, 1162 | "name": "OnLive Game System", 1163 | "variables": { 1164 | "screenscraper": { 1165 | "region": None, 1166 | }, 1167 | }, 1168 | }, 1169 | { 1170 | "ids": { 1171 | "igdb": 114, 1172 | "screenscraper": 134, 1173 | }, 1174 | "name": "Amiga CD32", 1175 | "variables": { 1176 | "screenscraper": { 1177 | "region": "wor", 1178 | }, 1179 | }, 1180 | }, 1181 | { 1182 | "ids": { 1183 | "igdb": 115, 1184 | "screenscraper": 217, 1185 | }, 1186 | "name": "Apple IIGS", 1187 | "variables": { 1188 | "screenscraper": { 1189 | "region": "wor", 1190 | }, 1191 | }, 1192 | }, 1193 | { 1194 | "ids": { 1195 | "igdb": 116, 1196 | "screenscraper": 84, 1197 | }, 1198 | "name": "Acorn Archimedes", 1199 | "variables": { 1200 | "screenscraper": { 1201 | "region": "wor", 1202 | }, 1203 | }, 1204 | }, 1205 | { 1206 | "ids": { 1207 | "igdb": 117, 1208 | "screenscraper": None, 1209 | }, 1210 | "name": "Philips CD-i", 1211 | "variables": { 1212 | "screenscraper": { 1213 | "region": None, 1214 | }, 1215 | }, 1216 | }, 1217 | { 1218 | "ids": { 1219 | "igdb": 118, 1220 | "screenscraper": 253, 1221 | }, 1222 | "name": "FM Towns", 1223 | "variables": { 1224 | "screenscraper": { 1225 | "region": "wor", 1226 | }, 1227 | }, 1228 | }, 1229 | { 1230 | "ids": { 1231 | "igdb": 119, 1232 | "screenscraper": 25, 1233 | }, 1234 | "name": "Neo Geo Pocket", 1235 | "variables": { 1236 | "screenscraper": { 1237 | "region": "wor", 1238 | }, 1239 | }, 1240 | }, 1241 | { 1242 | "ids": { 1243 | "igdb": 120, 1244 | "screenscraper": 82, 1245 | }, 1246 | "name": "Neo Geo Pocket Color", 1247 | "variables": { 1248 | "screenscraper": { 1249 | "region": "wor", 1250 | }, 1251 | }, 1252 | }, 1253 | { 1254 | "ids": { 1255 | "igdb": 121, 1256 | "screenscraper": 79, 1257 | }, 1258 | "name": "Sharp X68000", 1259 | "variables": { 1260 | "screenscraper": { 1261 | "region": "wor", 1262 | }, 1263 | }, 1264 | }, 1265 | { 1266 | "ids": { 1267 | "igdb": 122, 1268 | "screenscraper": None, 1269 | }, 1270 | "name": "Nuon", 1271 | "variables": { 1272 | "screenscraper": { 1273 | "region": None, 1274 | }, 1275 | }, 1276 | }, 1277 | { 1278 | "ids": { 1279 | "igdb": 123, 1280 | "screenscraper": 46, 1281 | }, 1282 | "name": "WonderSwan Color", 1283 | "variables": { 1284 | "screenscraper": { 1285 | "region": "wor", 1286 | }, 1287 | }, 1288 | }, 1289 | { 1290 | "ids": { 1291 | "igdb": 124, 1292 | "screenscraper": None, 1293 | }, 1294 | "name": "SwanCrystal", 1295 | "variables": { 1296 | "screenscraper": { 1297 | "region": None, 1298 | }, 1299 | }, 1300 | }, 1301 | { 1302 | "ids": { 1303 | "igdb": 125, 1304 | "screenscraper": 221, 1305 | }, 1306 | "name": "PC-8801", 1307 | "variables": { 1308 | "screenscraper": { 1309 | "region": "wor", 1310 | }, 1311 | }, 1312 | }, 1313 | { 1314 | "ids": { 1315 | "igdb": 126, 1316 | "screenscraper": 144, 1317 | }, 1318 | "name": "TRS-80", 1319 | "variables": { 1320 | "screenscraper": { 1321 | "region": "wor", 1322 | }, 1323 | }, 1324 | }, 1325 | { 1326 | "ids": { 1327 | "igdb": 127, 1328 | "screenscraper": 80, 1329 | }, 1330 | "name": "Fairchild Channel F", 1331 | "variables": { 1332 | "screenscraper": { 1333 | "region": "wor", 1334 | }, 1335 | }, 1336 | }, 1337 | { 1338 | "ids": { 1339 | "igdb": 128, 1340 | "screenscraper": 105, 1341 | }, 1342 | "name": "PC Engine SuperGrafx", 1343 | "variables": { 1344 | "screenscraper": { 1345 | "region": "wor", 1346 | }, 1347 | }, 1348 | }, 1349 | { 1350 | "ids": { 1351 | "igdb": 129, 1352 | "screenscraper": 205, 1353 | }, 1354 | "name": "Texas Instruments TI-99", 1355 | "variables": { 1356 | "screenscraper": { 1357 | "region": "wor", 1358 | }, 1359 | }, 1360 | }, 1361 | { 1362 | "ids": { 1363 | "igdb": 130, 1364 | "screenscraper": 225, 1365 | }, 1366 | "name": "Nintendo Switch", 1367 | "variables": { 1368 | "screenscraper": { 1369 | "region": "wor", 1370 | }, 1371 | }, 1372 | }, 1373 | { 1374 | "ids": { 1375 | "igdb": 131, 1376 | "screenscraper": None, 1377 | }, 1378 | "name": "Nintendo PlayStation", 1379 | "variables": { 1380 | "screenscraper": { 1381 | "region": None, 1382 | }, 1383 | }, 1384 | }, 1385 | { 1386 | "ids": { 1387 | "igdb": 132, 1388 | "screenscraper": None, 1389 | }, 1390 | "name": "Amazon Fire TV", 1391 | "variables": { 1392 | "screenscraper": { 1393 | "region": None, 1394 | }, 1395 | }, 1396 | }, 1397 | { 1398 | "ids": { 1399 | "igdb": 133, 1400 | "screenscraper": 104, 1401 | }, 1402 | "name": "Odyssey 2 / Videopac G7000", 1403 | "variables": { 1404 | "screenscraper": { 1405 | "region": "wor", 1406 | }, 1407 | }, 1408 | }, 1409 | { 1410 | "ids": { 1411 | "igdb": 134, 1412 | "screenscraper": 85, 1413 | }, 1414 | "name": "Acorn Electron", 1415 | "variables": { 1416 | "screenscraper": { 1417 | "region": "wor", 1418 | }, 1419 | }, 1420 | }, 1421 | { 1422 | "ids": { 1423 | "igdb": 135, 1424 | "screenscraper": None, 1425 | }, 1426 | "name": "Hyper Neo Geo 64", 1427 | "variables": { 1428 | "screenscraper": { 1429 | "region": None, 1430 | }, 1431 | }, 1432 | }, 1433 | { 1434 | "ids": { 1435 | "igdb": 136, 1436 | "screenscraper": 70, 1437 | }, 1438 | "name": "Neo Geo CD", 1439 | "variables": { 1440 | "screenscraper": { 1441 | "region": "wor", 1442 | }, 1443 | }, 1444 | }, 1445 | { 1446 | "ids": { 1447 | "igdb": 137, 1448 | "screenscraper": None, 1449 | }, 1450 | "name": "New Nintendo 3DS", 1451 | "variables": { 1452 | "screenscraper": { 1453 | "region": None, 1454 | }, 1455 | }, 1456 | }, 1457 | { 1458 | "ids": { 1459 | "igdb": 138, 1460 | "screenscraper": None, 1461 | }, 1462 | "name": "VC 4000", 1463 | "variables": { 1464 | "screenscraper": { 1465 | "region": None, 1466 | }, 1467 | }, 1468 | }, 1469 | { 1470 | "ids": { 1471 | "igdb": 139, 1472 | "screenscraper": None, 1473 | }, 1474 | "name": "1292 Advanced Programmable Video System", 1475 | "variables": { 1476 | "screenscraper": { 1477 | "region": None, 1478 | }, 1479 | }, 1480 | }, 1481 | { 1482 | "ids": { 1483 | "igdb": 140, 1484 | "screenscraper": None, 1485 | }, 1486 | "name": "AY-3-8500", 1487 | "variables": { 1488 | "screenscraper": { 1489 | "region": None, 1490 | }, 1491 | }, 1492 | }, 1493 | { 1494 | "ids": { 1495 | "igdb": 141, 1496 | "screenscraper": None, 1497 | }, 1498 | "name": "AY-3-8610", 1499 | "variables": { 1500 | "screenscraper": { 1501 | "region": None, 1502 | }, 1503 | }, 1504 | }, 1505 | { 1506 | "ids": { 1507 | "igdb": 142, 1508 | "screenscraper": None, 1509 | }, 1510 | "name": "PC-50X Family", 1511 | "variables": { 1512 | "screenscraper": { 1513 | "region": None, 1514 | }, 1515 | }, 1516 | }, 1517 | { 1518 | "ids": { 1519 | "igdb": 143, 1520 | "screenscraper": None, 1521 | }, 1522 | "name": "AY-3-8760", 1523 | "variables": { 1524 | "screenscraper": { 1525 | "region": None, 1526 | }, 1527 | }, 1528 | }, 1529 | { 1530 | "ids": { 1531 | "igdb": 144, 1532 | "screenscraper": None, 1533 | }, 1534 | "name": "AY-3-8710", 1535 | "variables": { 1536 | "screenscraper": { 1537 | "region": None, 1538 | }, 1539 | }, 1540 | }, 1541 | { 1542 | "ids": { 1543 | "igdb": 145, 1544 | "screenscraper": None, 1545 | }, 1546 | "name": "AY-3-8603", 1547 | "variables": { 1548 | "screenscraper": { 1549 | "region": None, 1550 | }, 1551 | }, 1552 | }, 1553 | { 1554 | "ids": { 1555 | "igdb": 146, 1556 | "screenscraper": None, 1557 | }, 1558 | "name": "AY-3-8605", 1559 | "variables": { 1560 | "screenscraper": { 1561 | "region": None, 1562 | }, 1563 | }, 1564 | }, 1565 | { 1566 | "ids": { 1567 | "igdb": 147, 1568 | "screenscraper": None, 1569 | }, 1570 | "name": "AY-3-8606", 1571 | "variables": { 1572 | "screenscraper": { 1573 | "region": None, 1574 | }, 1575 | }, 1576 | }, 1577 | { 1578 | "ids": { 1579 | "igdb": 148, 1580 | "screenscraper": None, 1581 | }, 1582 | "name": "AY-3-8607", 1583 | "variables": { 1584 | "screenscraper": { 1585 | "region": None, 1586 | }, 1587 | }, 1588 | }, 1589 | { 1590 | "ids": { 1591 | "igdb": 149, 1592 | "screenscraper": 208, 1593 | }, 1594 | "name": "PC-98", 1595 | "variables": { 1596 | "screenscraper": { 1597 | "region": "wor", 1598 | }, 1599 | }, 1600 | }, 1601 | { 1602 | "ids": { 1603 | "igdb": 150, 1604 | "screenscraper": 114, 1605 | }, 1606 | "name": "Turbografx-16/PC Engine CD", 1607 | "variables": { 1608 | "screenscraper": { 1609 | "region": "wor", 1610 | }, 1611 | }, 1612 | }, 1613 | { 1614 | "ids": { 1615 | "igdb": 151, 1616 | "screenscraper": 144, 1617 | }, 1618 | "name": "TRS-80 Color Computer", 1619 | "variables": { 1620 | "screenscraper": { 1621 | "region": "wor", 1622 | }, 1623 | }, 1624 | }, 1625 | { 1626 | "ids": { 1627 | "igdb": 152, 1628 | "screenscraper": 97, 1629 | }, 1630 | "name": "FM-7", 1631 | "variables": { 1632 | "screenscraper": { 1633 | "region": "jp", 1634 | }, 1635 | }, 1636 | }, 1637 | { 1638 | "ids": { 1639 | "igdb": 153, 1640 | "screenscraper": 91, 1641 | }, 1642 | "name": "Dragon 32/64", 1643 | "variables": { 1644 | "screenscraper": { 1645 | "region": "wor", 1646 | }, 1647 | }, 1648 | }, 1649 | { 1650 | "ids": { 1651 | "igdb": 154, 1652 | "screenscraper": None, 1653 | }, 1654 | "name": "Amstrad PCW", 1655 | "variables": { 1656 | "screenscraper": { 1657 | "region": None, 1658 | }, 1659 | }, 1660 | }, 1661 | { 1662 | "ids": { 1663 | "igdb": 155, 1664 | "screenscraper": None, 1665 | }, 1666 | "name": "Tatung Einstein", 1667 | "variables": { 1668 | "screenscraper": { 1669 | "region": None, 1670 | }, 1671 | }, 1672 | }, 1673 | { 1674 | "ids": { 1675 | "igdb": 156, 1676 | "screenscraper": 141, 1677 | }, 1678 | "name": "Thomson MO5", 1679 | "variables": { 1680 | "screenscraper": { 1681 | "region": "wor", 1682 | }, 1683 | }, 1684 | }, 1685 | { 1686 | "ids": { 1687 | "igdb": 157, 1688 | "screenscraper": None, 1689 | }, 1690 | "name": "NEC PC-6000 Series", 1691 | "variables": { 1692 | "screenscraper": { 1693 | "region": None, 1694 | }, 1695 | }, 1696 | }, 1697 | { 1698 | "ids": { 1699 | "igdb": 158, 1700 | "screenscraper": 129, 1701 | }, 1702 | "name": "Commodore CDTV", 1703 | "variables": { 1704 | "screenscraper": { 1705 | "region": "us", 1706 | }, 1707 | }, 1708 | }, 1709 | { 1710 | "ids": { 1711 | "igdb": 159, 1712 | "screenscraper": None, 1713 | }, 1714 | "name": "Nintendo DSi", 1715 | "variables": { 1716 | "screenscraper": { 1717 | "region": None, 1718 | }, 1719 | }, 1720 | }, 1721 | { 1722 | "ids": { 1723 | "igdb": 161, 1724 | "screenscraper": None, 1725 | }, 1726 | "name": "Windows Mixed Reality", 1727 | "variables": { 1728 | "screenscraper": { 1729 | "region": None, 1730 | }, 1731 | }, 1732 | }, 1733 | { 1734 | "ids": { 1735 | "igdb": 162, 1736 | "screenscraper": None, 1737 | }, 1738 | "name": "Oculus VR", 1739 | "variables": { 1740 | "screenscraper": { 1741 | "region": None, 1742 | }, 1743 | }, 1744 | }, 1745 | { 1746 | "ids": { 1747 | "igdb": 163, 1748 | "screenscraper": None, 1749 | }, 1750 | "name": "SteamVR", 1751 | "variables": { 1752 | "screenscraper": { 1753 | "region": None, 1754 | }, 1755 | }, 1756 | }, 1757 | { 1758 | "ids": { 1759 | "igdb": 164, 1760 | "screenscraper": None, 1761 | }, 1762 | "name": "Daydream", 1763 | "variables": { 1764 | "screenscraper": { 1765 | "region": None, 1766 | }, 1767 | }, 1768 | }, 1769 | { 1770 | "ids": { 1771 | "igdb": 165, 1772 | "screenscraper": None, 1773 | }, 1774 | "name": "PlayStation VR", 1775 | "variables": { 1776 | "screenscraper": { 1777 | "region": None, 1778 | }, 1779 | }, 1780 | }, 1781 | { 1782 | "ids": { 1783 | "igdb": 166, 1784 | "screenscraper": 211, 1785 | }, 1786 | "name": "Pokémon mini", 1787 | "variables": { 1788 | "screenscraper": { 1789 | "region": "wor", 1790 | }, 1791 | }, 1792 | }, 1793 | { 1794 | "ids": { 1795 | "igdb": 167, 1796 | "screenscraper": None, 1797 | }, 1798 | "name": "PlayStation 5", 1799 | "variables": { 1800 | "screenscraper": { 1801 | "region": None, 1802 | }, 1803 | }, 1804 | }, 1805 | { 1806 | "ids": { 1807 | "igdb": 169, 1808 | "screenscraper": None, 1809 | }, 1810 | "name": "Xbox Series X|S", 1811 | "variables": { 1812 | "screenscraper": { 1813 | "region": None, 1814 | }, 1815 | }, 1816 | }, 1817 | { 1818 | "ids": { 1819 | "igdb": 170, 1820 | "screenscraper": None, 1821 | }, 1822 | "name": "Google Stadia", 1823 | "variables": { 1824 | "screenscraper": { 1825 | "region": None, 1826 | }, 1827 | }, 1828 | }, 1829 | { 1830 | "ids": { 1831 | "igdb": 203, 1832 | "screenscraper": None, 1833 | }, 1834 | "name": "DUPLICATE Stadia", 1835 | "variables": { 1836 | "screenscraper": { 1837 | "region": None, 1838 | }, 1839 | }, 1840 | }, 1841 | { 1842 | "ids": { 1843 | "igdb": 236, 1844 | "screenscraper": 165, 1845 | }, 1846 | "name": "Exidy Sorcerer", 1847 | "variables": { 1848 | "screenscraper": { 1849 | "region": "wor", 1850 | }, 1851 | }, 1852 | }, 1853 | { 1854 | "ids": { 1855 | "igdb": 237, 1856 | "screenscraper": None, 1857 | }, 1858 | "name": "Sol-20", 1859 | "variables": { 1860 | "screenscraper": { 1861 | "region": None, 1862 | }, 1863 | }, 1864 | }, 1865 | { 1866 | "ids": { 1867 | "igdb": 238, 1868 | "screenscraper": None, 1869 | }, 1870 | "name": "DVD Player", 1871 | "variables": { 1872 | "screenscraper": { 1873 | "region": None, 1874 | }, 1875 | }, 1876 | }, 1877 | { 1878 | "ids": { 1879 | "igdb": 239, 1880 | "screenscraper": None, 1881 | }, 1882 | "name": "Blu-ray Player", 1883 | "variables": { 1884 | "screenscraper": { 1885 | "region": None, 1886 | }, 1887 | }, 1888 | }, 1889 | { 1890 | "ids": { 1891 | "igdb": 240, 1892 | "screenscraper": None, 1893 | }, 1894 | "name": "Zeebo", 1895 | "variables": { 1896 | "screenscraper": { 1897 | "region": None, 1898 | }, 1899 | }, 1900 | }, 1901 | { 1902 | "ids": { 1903 | "igdb": 274, 1904 | "screenscraper": 72, 1905 | }, 1906 | "name": "PC-FX", 1907 | "variables": { 1908 | "screenscraper": { 1909 | "region": "wor", 1910 | }, 1911 | }, 1912 | }, 1913 | { 1914 | "ids": { 1915 | "igdb": 306, 1916 | "screenscraper": 107, 1917 | }, 1918 | "name": "Satellaview", 1919 | "variables": { 1920 | "screenscraper": { 1921 | "region": "wor", 1922 | }, 1923 | }, 1924 | }, 1925 | { 1926 | "ids": { 1927 | "igdb": 307, 1928 | "screenscraper": 52, 1929 | }, 1930 | "name": "Game & Watch", 1931 | "variables": { 1932 | "screenscraper": { 1933 | "region": "wor", 1934 | }, 1935 | }, 1936 | }, 1937 | { 1938 | "ids": { 1939 | "igdb": 308, 1940 | "screenscraper": None, 1941 | }, 1942 | "name": "Playdia", 1943 | "variables": { 1944 | "screenscraper": { 1945 | "region": None, 1946 | }, 1947 | }, 1948 | }, 1949 | { 1950 | "ids": { 1951 | "igdb": 309, 1952 | "screenscraper": None, 1953 | }, 1954 | "name": "Evercade", 1955 | "variables": { 1956 | "screenscraper": { 1957 | "region": None, 1958 | }, 1959 | }, 1960 | }, 1961 | { 1962 | "ids": { 1963 | "igdb": 339, 1964 | "screenscraper": 250, 1965 | }, 1966 | "name": "Sega Pico", 1967 | "variables": { 1968 | "screenscraper": { 1969 | "region": "wor", 1970 | }, 1971 | }, 1972 | }, 1973 | { 1974 | "ids": { 1975 | "igdb": 372, 1976 | "screenscraper": None, 1977 | }, 1978 | "name": "OOParts", 1979 | "variables": { 1980 | "screenscraper": { 1981 | "region": None, 1982 | }, 1983 | }, 1984 | }, 1985 | { 1986 | "ids": { 1987 | "igdb": 373, 1988 | "screenscraper": 77, 1989 | }, 1990 | "name": "Sinclair ZX81", 1991 | "variables": { 1992 | "screenscraper": { 1993 | "region": "wor", 1994 | }, 1995 | }, 1996 | }, 1997 | { 1998 | "ids": { 1999 | "igdb": 374, 2000 | "screenscraper": None, 2001 | }, 2002 | "name": "Sharp MZ-2200", 2003 | "variables": { 2004 | "screenscraper": { 2005 | "region": None, 2006 | }, 2007 | }, 2008 | }, 2009 | { 2010 | "ids": { 2011 | "igdb": 375, 2012 | "screenscraper": None, 2013 | }, 2014 | "name": "Epoch Cassette Vision", 2015 | "variables": { 2016 | "screenscraper": { 2017 | "region": None, 2018 | }, 2019 | }, 2020 | }, 2021 | { 2022 | "ids": { 2023 | "igdb": 376, 2024 | "screenscraper": 67, 2025 | }, 2026 | "name": "Epoch Super Cassette Vision", 2027 | "variables": { 2028 | "screenscraper": { 2029 | "region": "wor", 2030 | }, 2031 | }, 2032 | }, 2033 | { 2034 | "ids": { 2035 | "igdb": 377, 2036 | "screenscraper": None, 2037 | }, 2038 | "name": "Plug & Play", 2039 | "variables": { 2040 | "screenscraper": { 2041 | "region": None, 2042 | }, 2043 | }, 2044 | }, 2045 | { 2046 | "ids": { 2047 | "igdb": 378, 2048 | "screenscraper": None, 2049 | }, 2050 | "name": "Gamate", 2051 | "variables": { 2052 | "screenscraper": { 2053 | "region": None, 2054 | }, 2055 | }, 2056 | }, 2057 | { 2058 | "ids": { 2059 | "igdb": 379, 2060 | "screenscraper": 121, 2061 | }, 2062 | "name": "Game.com", 2063 | "variables": { 2064 | "screenscraper": { 2065 | "region": "us", 2066 | }, 2067 | }, 2068 | }, 2069 | { 2070 | "ids": { 2071 | "igdb": 380, 2072 | "screenscraper": 98, 2073 | }, 2074 | "name": "Casio Loopy", 2075 | "variables": { 2076 | "screenscraper": { 2077 | "region": "wor", 2078 | }, 2079 | }, 2080 | }, 2081 | { 2082 | "ids": { 2083 | "igdb": 381, 2084 | "screenscraper": None, 2085 | }, 2086 | "name": "Playdate", 2087 | "variables": { 2088 | "screenscraper": { 2089 | "region": None, 2090 | }, 2091 | }, 2092 | }, 2093 | { 2094 | "ids": { 2095 | "igdb": 382, 2096 | "screenscraper": 115, 2097 | }, 2098 | "name": "Intellivision Amico", 2099 | "variables": { 2100 | "screenscraper": { 2101 | "region": "us", 2102 | }, 2103 | }, 2104 | }, 2105 | { 2106 | "ids": { 2107 | "igdb": 384, 2108 | "screenscraper": None, 2109 | }, 2110 | "name": "Oculus Quest", 2111 | "variables": { 2112 | "screenscraper": { 2113 | "region": None, 2114 | }, 2115 | }, 2116 | }, 2117 | { 2118 | "ids": { 2119 | "igdb": 385, 2120 | "screenscraper": None, 2121 | }, 2122 | "name": "Oculus Rift", 2123 | "variables": { 2124 | "screenscraper": { 2125 | "region": None, 2126 | }, 2127 | }, 2128 | }, 2129 | { 2130 | "ids": { 2131 | "igdb": 386, 2132 | "screenscraper": None, 2133 | }, 2134 | "name": "Meta Quest 2", 2135 | "variables": { 2136 | "screenscraper": { 2137 | "region": None, 2138 | }, 2139 | }, 2140 | }, 2141 | { 2142 | "ids": { 2143 | "igdb": 387, 2144 | "screenscraper": None, 2145 | }, 2146 | "name": "Oculus Go", 2147 | "variables": { 2148 | "screenscraper": { 2149 | "region": None, 2150 | }, 2151 | }, 2152 | }, 2153 | { 2154 | "ids": { 2155 | "igdb": 388, 2156 | "screenscraper": None, 2157 | }, 2158 | "name": "Gear VR", 2159 | "variables": { 2160 | "screenscraper": { 2161 | "region": None, 2162 | }, 2163 | }, 2164 | }, 2165 | { 2166 | "ids": { 2167 | "igdb": 389, 2168 | "screenscraper": None, 2169 | }, 2170 | "name": "AirConsole", 2171 | "variables": { 2172 | "screenscraper": { 2173 | "region": None, 2174 | }, 2175 | }, 2176 | }, 2177 | { 2178 | "ids": { 2179 | "igdb": 390, 2180 | "screenscraper": None, 2181 | }, 2182 | "name": "PlayStation VR2", 2183 | "variables": { 2184 | "screenscraper": { 2185 | "region": None, 2186 | }, 2187 | }, 2188 | }, 2189 | { 2190 | "ids": { 2191 | "igdb": 405, 2192 | "screenscraper": None, 2193 | }, 2194 | "name": "Windows Mobile", 2195 | "variables": { 2196 | "screenscraper": { 2197 | "region": None, 2198 | }, 2199 | }, 2200 | }, 2201 | { 2202 | "ids": { 2203 | "igdb": 406, 2204 | "screenscraper": None, 2205 | }, 2206 | "name": "Sinclair QL", 2207 | "variables": { 2208 | "screenscraper": { 2209 | "region": None, 2210 | }, 2211 | }, 2212 | }, 2213 | { 2214 | "ids": { 2215 | "igdb": 407, 2216 | "screenscraper": None, 2217 | }, 2218 | "name": "HyperScan", 2219 | "variables": { 2220 | "screenscraper": { 2221 | "region": None, 2222 | }, 2223 | }, 2224 | }, 2225 | { 2226 | "ids": { 2227 | "igdb": 408, 2228 | "screenscraper": 90, 2229 | }, 2230 | "name": "Mega Duck/Cougar Boy", 2231 | "variables": { 2232 | "screenscraper": { 2233 | "region": "wor", 2234 | }, 2235 | }, 2236 | }, 2237 | { 2238 | "ids": { 2239 | "igdb": 409, 2240 | "screenscraper": None, 2241 | }, 2242 | "name": "Legacy Computer", 2243 | "variables": { 2244 | "screenscraper": { 2245 | "region": None, 2246 | }, 2247 | }, 2248 | }, 2249 | { 2250 | "ids": { 2251 | "igdb": 410, 2252 | "screenscraper": 171, 2253 | }, 2254 | "name": "Atari Jaguar CD", 2255 | "variables": { 2256 | "screenscraper": { 2257 | "region": "wor", 2258 | }, 2259 | }, 2260 | }, 2261 | { 2262 | "ids": { 2263 | "igdb": 411, 2264 | "screenscraper": None, 2265 | }, 2266 | "name": "Handheld Electronic LCD", 2267 | "variables": { 2268 | "screenscraper": { 2269 | "region": None, 2270 | }, 2271 | }, 2272 | }, 2273 | { 2274 | "ids": { 2275 | "igdb": 412, 2276 | "screenscraper": None, 2277 | }, 2278 | "name": "Leapster", 2279 | "variables": { 2280 | "screenscraper": { 2281 | "region": None, 2282 | }, 2283 | }, 2284 | }, 2285 | { 2286 | "ids": { 2287 | "igdb": 413, 2288 | "screenscraper": None, 2289 | }, 2290 | "name": "Leapster Explorer/LeadPad Explorer", 2291 | "variables": { 2292 | "screenscraper": { 2293 | "region": None, 2294 | }, 2295 | }, 2296 | }, 2297 | { 2298 | "ids": { 2299 | "igdb": 414, 2300 | "screenscraper": None, 2301 | }, 2302 | "name": "LeapTV", 2303 | "variables": { 2304 | "screenscraper": { 2305 | "region": None, 2306 | }, 2307 | }, 2308 | }, 2309 | { 2310 | "ids": { 2311 | "igdb": 415, 2312 | "screenscraper": 207, 2313 | }, 2314 | "name": "Watara/QuickShot Supervision", 2315 | "variables": { 2316 | "screenscraper": { 2317 | "region": "wor", 2318 | }, 2319 | }, 2320 | }, 2321 | { 2322 | "ids": { 2323 | "igdb": 416, 2324 | "screenscraper": 122, 2325 | }, 2326 | "name": "Nintendo 64DD", 2327 | "variables": { 2328 | "screenscraper": { 2329 | "region": "wor", 2330 | }, 2331 | }, 2332 | }, 2333 | { 2334 | "ids": { 2335 | "igdb": 417, 2336 | "screenscraper": 219, 2337 | }, 2338 | "name": "Palm OS", 2339 | "variables": { 2340 | "screenscraper": { 2341 | "region": "wor", 2342 | }, 2343 | }, 2344 | }, 2345 | { 2346 | "ids": { 2347 | "igdb": 438, 2348 | "screenscraper": 263, 2349 | }, 2350 | "name": "Arduboy", 2351 | "variables": { 2352 | "screenscraper": { 2353 | "region": "wor", 2354 | }, 2355 | }, 2356 | }, 2357 | { 2358 | "ids": { 2359 | "igdb": 439, 2360 | "screenscraper": None, 2361 | }, 2362 | "name": "V.Smile", 2363 | "variables": { 2364 | "screenscraper": { 2365 | "region": None, 2366 | }, 2367 | }, 2368 | }, 2369 | { 2370 | "ids": { 2371 | "igdb": 440, 2372 | "screenscraper": None, 2373 | }, 2374 | "name": "Visual Memory Unit / Visual Memory System", 2375 | "variables": { 2376 | "screenscraper": { 2377 | "region": None, 2378 | }, 2379 | }, 2380 | }, 2381 | { 2382 | "ids": { 2383 | "igdb": 441, 2384 | "screenscraper": None, 2385 | }, 2386 | "name": "PocketStation", 2387 | "variables": { 2388 | "screenscraper": { 2389 | "region": None, 2390 | }, 2391 | }, 2392 | }, 2393 | ] 2394 | -------------------------------------------------------------------------------- /src/update_db.py: -------------------------------------------------------------------------------- 1 | # standard imports 2 | import argparse 3 | from datetime import timedelta 4 | import pathlib 5 | import json 6 | import os 7 | import re 8 | import time 9 | 10 | # lib imports 11 | import requests 12 | import requests_cache 13 | from dotenv import load_dotenv 14 | from igdb.wrapper import IGDBWrapper 15 | 16 | # local imports 17 | import platforms 18 | 19 | # setup environment if running locally 20 | load_dotenv() 21 | 22 | 23 | def igdb_authorization(client_id: str, client_secret: str) -> dict: 24 | """ 25 | Get the igdb authorization. 26 | 27 | Parameters 28 | ---------- 29 | client_id : str 30 | Twitch developer client id. 31 | client_secret : str 32 | Twitch developer client secret. 33 | 34 | Returns 35 | ------- 36 | dict 37 | Dictionary containing access token and expiration. 38 | """ 39 | auth_headers = dict( 40 | Accept='application/json', 41 | client_id=client_id, 42 | client_secret=client_secret, 43 | grant_type='client_credentials' 44 | ) 45 | 46 | token_url = 'https://id.twitch.tv/oauth2/token' 47 | 48 | authorization = requests.post(url=token_url, data=auth_headers) 49 | return authorization.json() 50 | 51 | 52 | def write_json_files(file_path: str, data: dict): 53 | """ 54 | Write dictionary to json file. 55 | 56 | Parameters 57 | ---------- 58 | file_path : str 59 | The file path to save the file at, excluding the file extension which will be `.json` 60 | data 61 | The dictionary data to write in the json file. 62 | """ 63 | # determine the directory 64 | directory = os.path.dirname(file_path) 65 | 66 | pathlib.Path(directory).mkdir(parents=True, exist_ok=True) 67 | 68 | with open(f'{file_path}.json', 'w') as f: 69 | json.dump(obj=data, fp=f, indent=args.indent) 70 | 71 | 72 | def get_youtube(video_ids: list) -> dict: 73 | """ 74 | Get metadata for YouTube videos. 75 | 76 | Parameters 77 | ---------- 78 | video_ids : list 79 | List of YouTube videos to get metadata for. 80 | 81 | Returns 82 | ------- 83 | dict 84 | JSON data formatted as a dictionary. 85 | """ 86 | # https://developers.google.com/youtube/v3/getting-started 87 | uri = 'https://www.googleapis.com/youtube/v3/videos' 88 | videos = ','.join(video_ids) 89 | fields = 'items(id,snippet(title,description,thumbnails,localized))' 90 | url = f'{uri}?id={videos}&key={args.youtube_api_key}&part=snippet&fields={fields}' 91 | headers = dict(Accept='application/json') 92 | 93 | session = requests_cache.CachedSession( 94 | cache_name='cache/youtube_cache', 95 | backend='sqlite', 96 | expire_after=timedelta(days=1), 97 | ) 98 | response = session.get(url=url, headers=headers) 99 | return response.json() 100 | 101 | 102 | def get_data(): 103 | """ 104 | Get data from IGDB and YouTube. 105 | 106 | Build a combined dictionary of IGDB and YouTube data for characters, games, platforms, and videos. Character data 107 | is appended to the games list. Games are appended to platforms. Videos metadata is also added to the games list. 108 | Individual files will be written to disk for each item. 109 | """ 110 | request_dict = dict( 111 | characters=dict( 112 | fields=[ 113 | 'character_gender.name', 114 | 'character_species.name', 115 | 'games', 116 | 'mug_shot.url', 117 | 'name', 118 | ], 119 | write_all=True, 120 | ), 121 | collections=dict( 122 | fields=[ 123 | 'games', 124 | 'name', 125 | 'slug', 126 | 'url', 127 | ], 128 | write_all=True, 129 | ), 130 | franchises=dict( 131 | fields=[ 132 | 'games', 133 | 'name', 134 | 'slug', 135 | 'url', 136 | ], 137 | write_all=True, 138 | ), 139 | games=dict( 140 | fields=[ 141 | 'age_ratings.organization.name', 142 | 'age_ratings.rating_category.rating', 143 | 'aggregated_rating', 144 | 'artworks.url', 145 | 'collections.name', 146 | 'cover.url', 147 | 'external_games.external_game_source.name', 148 | 'external_games.game_release_format.format', 149 | 'external_games.name', 150 | 'external_games.platform', 151 | 'external_games.uid', 152 | 'external_games.url', 153 | 'franchise.name', 154 | 'franchises.name', 155 | 'game_modes.name', 156 | 'genres.name', 157 | 'involved_companies.company.name', 158 | 'involved_companies.developer', 159 | 'multiplayer_modes.*', 160 | 'name', 161 | 'platforms', 162 | 'player_perspectives.name', 163 | 'rating', 164 | 'release_dates.date', 165 | 'release_dates.y', 166 | 'release_dates.platform', 167 | 'release_dates.release_region.region', 168 | 'screenshots.url', 169 | 'slug', 170 | 'storyline', 171 | 'summary', 172 | 'themes.name', 173 | 'url', 174 | 'videos.name', 175 | 'videos.video_id', 176 | ], 177 | append=dict( 178 | characters=dict( 179 | fields=[ 180 | 'id', 181 | 'gender', 182 | 'mug_shot', 183 | 'name', 184 | 'species', 185 | ] 186 | ) 187 | ), 188 | write_all=False, 189 | ), 190 | platforms=dict( 191 | fields=[ 192 | 'abbreviation', 193 | 'alternative_name', 194 | 'generation', 195 | 'name', 196 | 'platform_logo.url', 197 | 'platform_type.name', 198 | 'summary', 199 | 'url', 200 | 'versions.connectivity', 201 | 'versions.cpu', 202 | 'versions.graphics', 203 | 'versions.main_manufacturer.company.name', 204 | 'versions.media', 205 | 'versions.memory', 206 | 'versions.name', 207 | 'versions.os', 208 | 'versions.output', 209 | 'versions.platform_logo.url', 210 | 'versions.platform_version_release_dates.date', 211 | 'versions.platform_version_release_dates.human', 212 | 'versions.platform_version_release_dates.m', 213 | 'versions.platform_version_release_dates.release_region.region', 214 | 'versions.platform_version_release_dates.y', 215 | 'versions.resolutions', 216 | 'versions.sound', 217 | 'versions.storage', 218 | 'versions.summary', 219 | 'versions.url', 220 | ], 221 | append=dict( 222 | games=dict( 223 | fields=[ 224 | 'id', 225 | 'cover', 226 | 'name', 227 | 'release_dates', 228 | ] 229 | ) 230 | ), 231 | write_all=True, 232 | ), 233 | ) 234 | limit = 500 235 | full_dict = dict() 236 | 237 | for end_point, end_point_dict in request_dict.items(): 238 | print(f'now processing endpoint: {end_point}') 239 | offset = 0 240 | result = True 241 | full_dict[end_point] = dict() 242 | 243 | while result: 244 | try: 245 | byte_array = wrapper.api_request( 246 | endpoint=end_point, 247 | query=f'fields {", ".join(end_point_dict["fields"])}; limit {limit}; offset {offset};' 248 | ) 249 | except requests.exceptions.HTTPError: 250 | # handle too many requests 251 | time.sleep(1) 252 | continue 253 | 254 | json_result = json.loads(byte_array) # this is a list of dictionaries 255 | 256 | for item in json_result: 257 | full_dict[end_point][item['id']] = item 258 | 259 | if args.test_mode: 260 | break 261 | 262 | offset += limit 263 | 264 | if not json_result: 265 | result = False 266 | 267 | if end_point_dict['write_all']: 268 | # write the end_point file 269 | file_path = os.path.join(args.out_dir, end_point, 'all') 270 | write_json_files(file_path=file_path, data=full_dict[end_point]) 271 | 272 | print(f'{len(full_dict[end_point])} items processed in endpoint: {end_point}') 273 | 274 | for end_point, end_point_dict in request_dict.items(): 275 | try: 276 | append_dict = request_dict[end_point]['append'] 277 | except KeyError: 278 | pass 279 | else: 280 | for item_type, item_type_dict in append_dict.items(): 281 | print(f'adding {item_type} to {end_point}') 282 | for item_id_src, value in full_dict[item_type].items(): 283 | try: 284 | append_to = value[end_point] 285 | except KeyError: 286 | pass 287 | else: 288 | for item_id_dest in append_to: 289 | try: 290 | full_dict[end_point][item_id_dest] 291 | except KeyError: 292 | # the destination item doesn't exist 293 | pass 294 | else: 295 | try: 296 | full_dict[end_point][item_id_dest][item_type] 297 | except KeyError: 298 | full_dict[end_point][item_id_dest][item_type] = [] 299 | finally: 300 | full_dict[end_point][item_id_dest][item_type].append(dict()) 301 | 302 | for field in item_type_dict['fields']: 303 | try: 304 | field_value = value[field] 305 | except KeyError: 306 | # this item doesn't have the specified field, no problem 307 | pass 308 | else: 309 | full_dict[end_point][item_id_dest][item_type][-1][field] = field_value 310 | 311 | # create buckets and get list of all videos 312 | print('creating buckets / collecting video ids') 313 | buckets = dict() 314 | all_videos = [] 315 | for game_id, game_data in full_dict['games'].items(): 316 | # games 317 | bucket = "".join(x.strip().lower() for x in game_data['name'][:2] if x.isalnum()) 318 | if not re.fullmatch(r'[\da-z]+', bucket): 319 | bucket = '@' 320 | 321 | try: 322 | buckets[bucket] 323 | except KeyError: 324 | buckets[bucket] = dict() 325 | finally: 326 | buckets[bucket][game_id] = dict( 327 | name=game_data['name'] 328 | ) 329 | 330 | # videos 331 | try: 332 | game_videos = game_data['videos'] 333 | except KeyError: 334 | # no videos for this game 335 | pass 336 | else: 337 | for video in game_videos: 338 | video_id = video['video_id'] 339 | if video_id not in all_videos: 340 | all_videos.append(video_id) 341 | 342 | # write the full game index 343 | for bucket, bucket_data in buckets.items(): 344 | file_path = os.path.join(args.out_dir, 'buckets', str(bucket)) 345 | write_json_files(file_path=file_path, data=bucket_data) 346 | 347 | # get data for videos 348 | # we can only make 10,000 requests to YouTube api per day, so let's get as much data as possible in each request 349 | print('collecting video metadata') 350 | 351 | end_point = 'videos' 352 | full_dict[end_point] = dict() 353 | 354 | all_videos.sort() 355 | 356 | cache_file = 'cache/video_groups.json' 357 | os.makedirs(os.path.dirname(cache_file), exist_ok=True) 358 | 359 | group_size = 50 360 | if not os.path.isfile(cache_file): 361 | all_video_groups = [all_videos[x:x + group_size] for x in range(0, len(all_videos), group_size)] 362 | else: 363 | with open(cache_file, 'r') as f: 364 | cached_video_groups = json.load(f) 365 | 366 | # Filter cached video groups to include only those where all videos are in all_videos 367 | all_video_groups = [x for x in cached_video_groups if all(video in all_videos for video in x)] 368 | 369 | # Find videos that are not in any cached video group 370 | uncached_videos = [video for video in all_videos if not any(video in group for group in cached_video_groups)] 371 | 372 | # Append uncached videos in groups of up to 50 to all_video_groups 373 | uncached_video_groups = [uncached_videos[x:x + group_size] for x in range(0, len(uncached_videos), group_size)] 374 | all_video_groups.extend(uncached_video_groups) 375 | 376 | # write the new video groups to cache 377 | with open(cache_file, 'w') as f: 378 | json.dump(all_video_groups, f) 379 | 380 | for video_group in all_video_groups: 381 | json_result = get_youtube(video_ids=video_group) 382 | 383 | try: 384 | for item in json_result['items']: 385 | full_dict[end_point][item['id']] = item 386 | except KeyError as e: 387 | print(f'KeyError: {e}\n\n{json.dumps(json_result, indent=2)}') 388 | 389 | # get video details for games 390 | print('adding videos to games') 391 | for game_id, game_data in full_dict['games'].items(): 392 | try: 393 | game_videos = game_data['videos'] 394 | except KeyError: 395 | # no videos for this game 396 | pass 397 | else: 398 | for video in game_videos: 399 | try: 400 | video_details = full_dict['videos'][video['video_id']] 401 | except (IndexError, KeyError): 402 | # no data for this video 403 | pass 404 | else: 405 | video_thumbs = video_details['snippet']['thumbnails'] 406 | 407 | # remove keys that have no value 408 | # create a copy of original dictionary since we may alter it, https://stackoverflow.com/a/33815594 409 | for video_key, video_value in dict(video_thumbs).items(): 410 | if video_value is None: 411 | del video_thumbs[video_key] 412 | 413 | # sort the video thumbnails by width into a list 414 | video_thumbs = sorted(video_thumbs.items(), key=lambda x: x[1]['width'], reverse=True) 415 | 416 | # the final video thumbnail 417 | video['url'] = f'https://www.youtube.com/watch?v={video_details["id"]}' 418 | video['title'] = video_details['snippet']['title'] 419 | video['thumb'] = video_thumbs[0][1]['url'] 420 | 421 | # write the individual files 422 | for end_point, end_point_dict in full_dict.items(): 423 | print(f'writing individual files for {end_point}') 424 | for item_id, data in end_point_dict.items(): 425 | file_path = os.path.join(args.out_dir, end_point, str(item_id)) 426 | write_json_files(file_path=file_path, data=data) 427 | 428 | 429 | def get_platform_cross_reference(): 430 | """ 431 | Write platform cross-reference to json files. 432 | """ 433 | end_point = 'platforms' 434 | 435 | # write the end_point file 436 | file_path = os.path.join(args.out_dir, end_point, 'cross-reference') 437 | write_json_files(file_path=file_path, data=platforms.cross_reference) 438 | 439 | 440 | if __name__ == '__main__': 441 | # setup arguments using argparse 442 | parser = argparse.ArgumentParser(description="Download entire igdb database.") 443 | parser.add_argument( 444 | '-o', 445 | '--out_dir', 446 | type=str, 447 | required=False, 448 | default='gh-pages', 449 | help='Output directory for json files.', 450 | ) 451 | parser.add_argument( 452 | '--twitch_client_id', 453 | type=str, 454 | required=False, 455 | default=os.getenv('TWITCH_CLIENT_ID'), 456 | help='Twitch developer client id', 457 | ) 458 | parser.add_argument( 459 | '--twitch_client_secret', 460 | type=str, 461 | required=False, 462 | default=os.getenv('TWITCH_CLIENT_SECRET'), 463 | help='Twitch developer client secret', 464 | ) 465 | parser.add_argument( 466 | '--youtube_api_key', 467 | type=str, 468 | required=False, 469 | default=os.getenv('YOUTUBE_API_KEY'), 470 | help='Youtube API key', 471 | ) 472 | parser.add_argument( 473 | '-t', 474 | '--test_mode', 475 | action='store_true', 476 | help='Only write one item file per end point, per request.', 477 | ) 478 | parser.add_argument( 479 | '-i', 480 | '--indent_json', 481 | action='store_true', 482 | help='Indent json files.', 483 | ) 484 | 485 | args = parser.parse_args() 486 | args.indent = 4 if args.indent_json else None 487 | 488 | if not args.twitch_client_id or not args.twitch_client_secret or not args.youtube_api_key: 489 | raise SystemExit('Secrets not supplied. Required secrets are "TWITCH_CLIENT_ID", "TWITCH_CLIENT_SECRET" and ' 490 | '"YOUTUBE_API_KEY". They should be placed in org/repo secrets if using github, ' 491 | 'or ".env" file if running local.') 492 | 493 | # setup igdb authorization and wrapper 494 | auth = igdb_authorization(client_id=args.twitch_client_id, client_secret=args.twitch_client_secret) 495 | wrapper = IGDBWrapper(client_id=args.twitch_client_id, auth_token=auth['access_token']) 496 | 497 | # get date, process dictionaries and write data 498 | get_data() 499 | get_platform_cross_reference() 500 | --------------------------------------------------------------------------------