aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/banlist-cn.json75
-rw-r--r--data/banlist-md.json198
-rw-r--r--data/banlist.json191
-rw-r--r--data/cn-genbanlist.py33
-rw-r--r--data/genbanlist.py30
-rw-r--r--data/md-genbanlist.py33
-rw-r--r--data/split.py7
-rw-r--r--data/update.sh7
8 files changed, 574 insertions, 0 deletions
diff --git a/data/banlist-cn.json b/data/banlist-cn.json
new file mode 100644
index 0000000..c566503
--- /dev/null
+++ b/data/banlist-cn.json
@@ -0,0 +1,75 @@
+{
+ "date": "2025-01-01",
+ "regulation": {
+ "4426": 0,
+ "4678": 1,
+ "4821": 1,
+ "4842": 1,
+ "4844": 0,
+ "5236": 1,
+ "5328": 1,
+ "5537": 1,
+ "5605": 0,
+ "5622": 1,
+ "5740": 1,
+ "6161": 2,
+ "6901": 1,
+ "7652": 1,
+ "7673": 2,
+ "7747": 2,
+ "9153": 0,
+ "9271": 2,
+ "9455": 2,
+ "10354": 0,
+ "12047": 2,
+ "12070": 1,
+ "12074": 1,
+ "12080": 0,
+ "12108": 0,
+ "12465": 2,
+ "12800": 2,
+ "12801": 2,
+ "12960": 0,
+ "12978": 1,
+ "13447": 1,
+ "13507": 1,
+ "13508": 1,
+ "13597": 0,
+ "13619": 2,
+ "13622": 1,
+ "13674": 1,
+ "14128": 0,
+ "14130": 0,
+ "14304": 2,
+ "14314": 0,
+ "14627": 1,
+ "15756": 1,
+ "16751": 0,
+ "17381": 1,
+ "17414": 2,
+ "17415": 2,
+ "17416": 1,
+ "17417": 1,
+ "17444": 0,
+ "17451": 0,
+ "17462": 1,
+ "17762": 1,
+ "17764": 1,
+ "17768": 1,
+ "17769": 1,
+ "17992": 2,
+ "18204": 1,
+ "18524": 1,
+ "18845": 1,
+ "19027": 1,
+ "19148": 1,
+ "19149": 1,
+ "19188": 1,
+ "19196": 1,
+ "19467": 1,
+ "19859": 1,
+ "19900": 1,
+ "20282": 2,
+ "20575": 2
+ }
+}
diff --git a/data/banlist-md.json b/data/banlist-md.json
new file mode 100644
index 0000000..9b2db11
--- /dev/null
+++ b/data/banlist-md.json
@@ -0,0 +1,198 @@
+{
+ "date": "2025-02-06",
+ "regulation": {
+ "4023": 1,
+ "4024": 1,
+ "4025": 1,
+ "4026": 1,
+ "4027": 1,
+ "4095": 0,
+ "4343": 2,
+ "4426": 0,
+ "4518": 0,
+ "4678": 1,
+ "4812": 0,
+ "4821": 1,
+ "4842": 1,
+ "4844": 0,
+ "4851": 0,
+ "4885": 0,
+ "4891": 1,
+ "4900": 0,
+ "4901": 0,
+ "4907": 0,
+ "4910": 0,
+ "4911": 0,
+ "4960": 0,
+ "4966": 0,
+ "4984": 0,
+ "5008": 1,
+ "5123": 0,
+ "5127": 0,
+ "5195": 0,
+ "5236": 1,
+ "5247": 0,
+ "5328": 1,
+ "5371": 0,
+ "5389": 0,
+ "5399": 0,
+ "5406": 0,
+ "5433": 0,
+ "5446": 0,
+ "5477": 0,
+ "5537": 0,
+ "5539": 0,
+ "5576": 0,
+ "5605": 0,
+ "5622": 1,
+ "5657": 0,
+ "5671": 0,
+ "5724": 0,
+ "5740": 1,
+ "5906": 0,
+ "5916": 0,
+ "5945": 0,
+ "6075": 2,
+ "6078": 0,
+ "6161": 2,
+ "6283": 2,
+ "6444": 0,
+ "6458": 0,
+ "6654": 0,
+ "6708": 0,
+ "6885": 0,
+ "6901": 0,
+ "7386": 0,
+ "7405": 1,
+ "7435": 0,
+ "7601": 0,
+ "7652": 0,
+ "7714": 0,
+ "7747": 2,
+ "7916": 0,
+ "7934": 1,
+ "8085": 0,
+ "8087": 0,
+ "8159": 0,
+ "8197": 1,
+ "8318": 0,
+ "8440": 0,
+ "8469": 1,
+ "8472": 0,
+ "8515": 0,
+ "8602": 1,
+ "8733": 0,
+ "8993": 1,
+ "9095": 0,
+ "9153": 0,
+ "9256": 1,
+ "9455": 2,
+ "9554": 1,
+ "9742": 0,
+ "9778": 1,
+ "9821": 0,
+ "9860": 0,
+ "9957": 0,
+ "10695": 0,
+ "11159": 0,
+ "11207": 0,
+ "11296": 0,
+ "11344": 0,
+ "11518": 0,
+ "11529": 1,
+ "11651": 0,
+ "11840": 1,
+ "11932": 0,
+ "11960": 0,
+ "12070": 1,
+ "12074": 1,
+ "12080": 0,
+ "12258": 0,
+ "12412": 0,
+ "12433": 0,
+ "12441": 1,
+ "12465": 1,
+ "12642": 0,
+ "12749": 1,
+ "12786": 0,
+ "12800": 1,
+ "12801": 1,
+ "12906": 1,
+ "12960": 0,
+ "12978": 0,
+ "13077": 1,
+ "13130": 1,
+ "13166": 0,
+ "13252": 1,
+ "13256": 1,
+ "13405": 1,
+ "13447": 1,
+ "13507": 1,
+ "13508": 0,
+ "13571": 0,
+ "13619": 2,
+ "13622": 2,
+ "13836": 0,
+ "14128": 0,
+ "14130": 0,
+ "14144": 1,
+ "14301": 2,
+ "14314": 0,
+ "14627": 1,
+ "14740": 1,
+ "14876": 2,
+ "14932": 0,
+ "14944": 1,
+ "14987": 2,
+ "15035": 0,
+ "15138": 2,
+ "15141": 2,
+ "15262": 1,
+ "15277": 0,
+ "15286": 2,
+ "15756": 0,
+ "16544": 1,
+ "17066": 1,
+ "17364": 2,
+ "17365": 2,
+ "17373": 2,
+ "17375": 1,
+ "17376": 2,
+ "17377": 2,
+ "17381": 1,
+ "17405": 2,
+ "17406": 2,
+ "17414": 0,
+ "17415": 2,
+ "17416": 1,
+ "17444": 1,
+ "17462": 0,
+ "17472": 0,
+ "17474": 1,
+ "17603": 1,
+ "17604": 1,
+ "17605": 0,
+ "17606": 0,
+ "17762": 1,
+ "17768": 1,
+ "17769": 2,
+ "17992": 2,
+ "18003": 2,
+ "18013": 1,
+ "18153": 1,
+ "18204": 1,
+ "18442": 1,
+ "18481": 2,
+ "19027": 2,
+ "19149": 1,
+ "19196": 1,
+ "19398": 2,
+ "19467": 1,
+ "19859": 1,
+ "19900": 1,
+ "19901": 2,
+ "19902": 2,
+ "20037": 2,
+ "20196": 2
+ }
+}
diff --git a/data/banlist.json b/data/banlist.json
new file mode 100644
index 0000000..2a6c275
--- /dev/null
+++ b/data/banlist.json
@@ -0,0 +1,191 @@
+{
+ "date": "2025-01-01",
+ "regulation": {
+ "4023": 1,
+ "4024": 1,
+ "4025": 1,
+ "4026": 1,
+ "4027": 1,
+ "4095": 0,
+ "4426": 0,
+ "4518": 0,
+ "4597": 2,
+ "4678": 1,
+ "4812": 0,
+ "4821": 1,
+ "4842": 1,
+ "4844": 0,
+ "4851": 0,
+ "4885": 0,
+ "4891": 1,
+ "4898": 2,
+ "4900": 0,
+ "4901": 0,
+ "4907": 0,
+ "4910": 0,
+ "4911": 0,
+ "4913": 1,
+ "4960": 0,
+ "4966": 0,
+ "5123": 0,
+ "5127": 0,
+ "5195": 0,
+ "5236": 1,
+ "5328": 1,
+ "5371": 0,
+ "5389": 0,
+ "5399": 0,
+ "5406": 0,
+ "5433": 0,
+ "5446": 0,
+ "5477": 0,
+ "5537": 1,
+ "5539": 0,
+ "5605": 0,
+ "5622": 1,
+ "5657": 0,
+ "5671": 0,
+ "5724": 0,
+ "5740": 1,
+ "5846": 1,
+ "5868": 0,
+ "5906": 0,
+ "5945": 0,
+ "6078": 0,
+ "6161": 1,
+ "6444": 0,
+ "6458": 0,
+ "6654": 0,
+ "6708": 0,
+ "6885": 0,
+ "6901": 1,
+ "7386": 0,
+ "7435": 0,
+ "7445": 2,
+ "7570": 1,
+ "7601": 0,
+ "7652": 1,
+ "7673": 1,
+ "7714": 0,
+ "7747": 2,
+ "7934": 1,
+ "8085": 0,
+ "8159": 0,
+ "8197": 1,
+ "8318": 0,
+ "8440": 0,
+ "8472": 0,
+ "8602": 1,
+ "8733": 0,
+ "9153": 0,
+ "9256": 1,
+ "9271": 1,
+ "9455": 2,
+ "9554": 1,
+ "9742": 0,
+ "9778": 1,
+ "9821": 0,
+ "9860": 0,
+ "9957": 0,
+ "10216": 1,
+ "10354": 0,
+ "11159": 0,
+ "11195": 1,
+ "11207": 0,
+ "11296": 0,
+ "11344": 0,
+ "11518": 0,
+ "11529": 1,
+ "11651": 0,
+ "11840": 1,
+ "11932": 0,
+ "12047": 2,
+ "12070": 1,
+ "12074": 1,
+ "12080": 0,
+ "12108": 0,
+ "12111": 2,
+ "12412": 0,
+ "12433": 1,
+ "12465": 2,
+ "12642": 0,
+ "12749": 1,
+ "12786": 0,
+ "12788": 1,
+ "12794": 2,
+ "12800": 2,
+ "12801": 2,
+ "12906": 1,
+ "12907": 2,
+ "12938": 2,
+ "12960": 0,
+ "12978": 1,
+ "13107": 1,
+ "13447": 1,
+ "13507": 1,
+ "13508": 0,
+ "13597": 0,
+ "13598": 0,
+ "13619": 2,
+ "13622": 1,
+ "13674": 1,
+ "13836": 0,
+ "14128": 0,
+ "14130": 0,
+ "14144": 2,
+ "14304": 2,
+ "14314": 0,
+ "14627": 1,
+ "14740": 2,
+ "14932": 0,
+ "14944": 0,
+ "14952": 1,
+ "15035": 0,
+ "15277": 0,
+ "15756": 1,
+ "16751": 0,
+ "17066": 1,
+ "17381": 1,
+ "17405": 1,
+ "17406": 1,
+ "17414": 1,
+ "17415": 1,
+ "17416": 1,
+ "17417": 1,
+ "17430": 1,
+ "17444": 0,
+ "17451": 0,
+ "17457": 1,
+ "17462": 1,
+ "17603": 1,
+ "17604": 1,
+ "17605": 0,
+ "17606": 0,
+ "17762": 1,
+ "17764": 1,
+ "17765": 1,
+ "17768": 0,
+ "17769": 1,
+ "17992": 2,
+ "18149": 1,
+ "18153": 1,
+ "18204": 1,
+ "18222": 2,
+ "18524": 1,
+ "18845": 1,
+ "19027": 1,
+ "19148": 1,
+ "19149": 1,
+ "19188": 1,
+ "19398": 2,
+ "19467": 1,
+ "19859": 1,
+ "19900": 1,
+ "19902": 2,
+ "20037": 1,
+ "20196": 1,
+ "20240": 1,
+ "20282": 2,
+ "20575": 1
+ }
+}
diff --git a/data/cn-genbanlist.py b/data/cn-genbanlist.py
new file mode 100644
index 0000000..c80d7f0
--- /dev/null
+++ b/data/cn-genbanlist.py
@@ -0,0 +1,33 @@
+import json
+
+cardId = dict()
+cards = None
+with open('cards.json', 'r') as fp:
+ cards = json.load(fp)
+
+result = dict()
+result['ban'] = []
+result['limit'] = []
+result['semiLimit'] = []
+
+for k in cards:
+ cardId[k] = cards[k]['id']
+ if 'sc_name' not in cards[k]:
+ result['ban'].append(str(cardId[k]))
+
+banlist = None
+with open('banlist-cn.json', 'r') as fp:
+ banlist = json.load(fp)
+
+regulation = banlist['regulation']
+for cid in regulation:
+ sid = str(cardId[cid])
+ if regulation[cid] == 0:
+ result['ban'].append(sid)
+ if regulation[cid] == 1:
+ result['limit'].append(sid)
+ if regulation[cid] == 2:
+ result['semiLimit'].append(sid)
+result['ban'] = list(set(result['ban']))
+print(json.dumps(result, indent=4))
+
diff --git a/data/genbanlist.py b/data/genbanlist.py
new file mode 100644
index 0000000..65c668e
--- /dev/null
+++ b/data/genbanlist.py
@@ -0,0 +1,30 @@
+import json
+
+cardId = dict()
+cards = None
+with open('cards.json', 'r') as fp:
+ cards = json.load(fp)
+
+result = dict()
+result['ban'] = []
+result['limit'] = []
+result['semiLimit'] = []
+
+for k in cards:
+ cardId[k] = cards[k]['id']
+
+banlist = None
+with open('banlist.json', 'r') as fp:
+ banlist = json.load(fp)
+
+regulation = banlist['regulation']
+for cid in regulation:
+ sid = str(cardId[cid])
+ if regulation[cid] == 0:
+ result['ban'].append(sid)
+ if regulation[cid] == 1:
+ result['limit'].append(sid)
+ if regulation[cid] == 2:
+ result['semiLimit'].append(sid)
+print(json.dumps(result, indent=4))
+
diff --git a/data/md-genbanlist.py b/data/md-genbanlist.py
new file mode 100644
index 0000000..a34ab54
--- /dev/null
+++ b/data/md-genbanlist.py
@@ -0,0 +1,33 @@
+import json
+
+cardId = dict()
+cards = None
+with open('cards.json', 'r') as fp:
+ cards = json.load(fp)
+
+result = dict()
+result['ban'] = []
+result['limit'] = []
+result['semiLimit'] = []
+
+for k in cards:
+ cardId[k] = cards[k]['id']
+ if 'md_name' not in cards[k]:
+ result['ban'].append(str(cardId[k]))
+
+banlist = None
+with open('banlist-md.json', 'r') as fp:
+ banlist = json.load(fp)
+
+regulation = banlist['regulation']
+for cid in regulation:
+ sid = str(cardId[cid])
+ if regulation[cid] == 0:
+ result['ban'].append(sid)
+ if regulation[cid] == 1:
+ result['limit'].append(sid)
+ if regulation[cid] == 2:
+ result['semiLimit'].append(sid)
+result['ban'] = list(set(result['ban']))
+print(json.dumps(result, indent=4))
+
diff --git a/data/split.py b/data/split.py
index 1f93fca..9eb8a98 100644
--- a/data/split.py
+++ b/data/split.py
@@ -20,3 +20,10 @@ def split_file(input_filename):
# 示例用法
split_file('card_db.json')
+version = None
+with open("card_db_parts/version.json", 'r') as fp:
+ version = fp.read()
+ version = int(version)
+with open("card_db_parts/version.json", 'w') as fp:
+ fp.write(str(version+1))
+
diff --git a/data/update.sh b/data/update.sh
index 7ae5351..1e2fd59 100644
--- a/data/update.sh
+++ b/data/update.sh
@@ -2,4 +2,11 @@ curl https://ygocdb.com/api/v0/cards.zip -o cards.zip
unzip cards.zip
rm cards.zip
python3 build-card-info.py
+python3 split.py
+python3 genbanlist.py > ../src/ocg_banlist.json
+python3 cn-genbanlist.py > ../src/cnocg_banlist.json
+python3 md-genbanlist.py > ../src/md_banlist.json
+rsync -avz ./card_db_parts/ root@bdwg:/volume/webroot/card_db_parts/
+cd ..
+sh deploy.sh