Initial commit
This commit is contained in:
commit
040f155b3a
19 changed files with 741 additions and 0 deletions
27
zuginfo_playbooks/templates/account_or_whatever.json.j2
Normal file
27
zuginfo_playbooks/templates/account_or_whatever.json.j2
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrUserDetails",
|
||||
"req": {
|
||||
"userId": null
|
||||
},
|
||||
"id": "1|2|"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrUserCreate",
|
||||
"req": {
|
||||
"language": "de",
|
||||
"availableChannels": [
|
||||
{
|
||||
"channelId": "",
|
||||
"type": "WEBPUSH",
|
||||
"address": "{\"endpoint\":\"{{ push_endpoint }}\",\"keys\":{\"auth\":\"{{ push_key_auth }}\",\"p256dh\":\"{{ push_key_p256dh }}\"}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": "1|3|"
|
||||
}
|
||||
]
|
||||
}
|
||||
27
zuginfo_playbooks/templates/delete_account.json.j2
Normal file
27
zuginfo_playbooks/templates/delete_account.json.j2
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrUserDelete",
|
||||
"req": {
|
||||
"userId": "{{ user_id }}"
|
||||
},
|
||||
"id": "1|5|"
|
||||
}
|
||||
]
|
||||
}
|
||||
28
zuginfo_playbooks/templates/delete_subscription.json.j2
Normal file
28
zuginfo_playbooks/templates/delete_subscription.json.j2
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrDelete",
|
||||
"req": {
|
||||
"subscrId": {{ subscription_id }},
|
||||
"userId": "{{ user_id }}"
|
||||
},
|
||||
"id": "1|13|"
|
||||
}
|
||||
]
|
||||
}
|
||||
28
zuginfo_playbooks/templates/detail_subscriptions.json.j2
Normal file
28
zuginfo_playbooks/templates/detail_subscriptions.json.j2
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrDetails",
|
||||
"req": {
|
||||
"subscrId": {{ subscription_id }},
|
||||
"userId": "{{ user_id }}"
|
||||
},
|
||||
"id": "1|10|"
|
||||
}
|
||||
]
|
||||
}
|
||||
27
zuginfo_playbooks/templates/get_channel_id.json.j2
Normal file
27
zuginfo_playbooks/templates/get_channel_id.json.j2
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrUserDetails",
|
||||
"req": {
|
||||
"userId": "{{ user_id }}"
|
||||
},
|
||||
"id": "1|4|"
|
||||
}
|
||||
]
|
||||
}
|
||||
27
zuginfo_playbooks/templates/list_subscriptions.json.j2
Normal file
27
zuginfo_playbooks/templates/list_subscriptions.json.j2
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrSearch",
|
||||
"req": {
|
||||
"userId": "{{ user_id }}"
|
||||
},
|
||||
"id": "1|9|"
|
||||
}
|
||||
]
|
||||
}
|
||||
30
zuginfo_playbooks/templates/mysterious_id.json.j2
Normal file
30
zuginfo_playbooks/templates/mysterious_id.json.j2
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"req": {
|
||||
"getMapLayerConfig": true,
|
||||
"getConGroups": false,
|
||||
"getServerDateTime": true,
|
||||
"getTimeTablePeriod": true,
|
||||
"getEuSpiritRegions": true
|
||||
},
|
||||
"meth": "ServerInfo",
|
||||
"id": "1|0|"
|
||||
}
|
||||
]
|
||||
}
|
||||
77
zuginfo_playbooks/templates/subscription_s4.json.j2
Normal file
77
zuginfo_playbooks/templates/subscription_s4.json.j2
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrCreate",
|
||||
"req": {
|
||||
"statSubscr": {
|
||||
"hysteresis": {
|
||||
"himFltrL": [
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "4"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "2"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "3"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jnyFltrL": [
|
||||
{
|
||||
"type": "LINEID",
|
||||
"mode": "INC",
|
||||
"value": 92404
|
||||
}
|
||||
],
|
||||
"serviceDays": {
|
||||
"selectedWeekdays": "1111111",
|
||||
"beginDate": "20250615",
|
||||
"endDate": "20331211",
|
||||
"beginTime": "000000",
|
||||
"endTime": "235959"
|
||||
}
|
||||
},
|
||||
"userId": "{{ user_id }}",
|
||||
"channels": [
|
||||
{
|
||||
"channelId": "{{ channel_id }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": "1|5|"
|
||||
}
|
||||
]
|
||||
}
|
||||
78
zuginfo_playbooks/templates/update_subscription.json.j2
Normal file
78
zuginfo_playbooks/templates/update_subscription.json.j2
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrUpdate",
|
||||
"req": {
|
||||
"userId": "{{ user_id }}",
|
||||
"subscrId": {{ subscription_id }},
|
||||
"statSubscr": {
|
||||
"hysteresis": {
|
||||
"himFltrL": [
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "4"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "2"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "3"
|
||||
},
|
||||
{
|
||||
"type": "HIMCAT",
|
||||
"mode": "INC",
|
||||
"value": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jnyFltrL": [
|
||||
{
|
||||
"type": "LINEID",
|
||||
"mode": "INC",
|
||||
"value": 92404
|
||||
}
|
||||
],
|
||||
"serviceDays": {
|
||||
"selectedWeekdays": "1111110",
|
||||
"beginDate": "20250615",
|
||||
"endDate": "20331211",
|
||||
"beginTime": "00000000",
|
||||
"endTime": "00235959"
|
||||
}
|
||||
},
|
||||
"channels": [
|
||||
{
|
||||
"channelId": "{{ channel_id }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": "1|12|"
|
||||
}
|
||||
]
|
||||
}
|
||||
28
zuginfo_playbooks/templates/verify_subscription.json.j2
Normal file
28
zuginfo_playbooks/templates/verify_subscription.json.j2
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"id": "{{ mysterious_id }}",
|
||||
"ver": "1.24",
|
||||
"lang": "deu",
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "{{ aid }}"
|
||||
},
|
||||
"client": {
|
||||
"id": "HAFAS",
|
||||
"type": "WEB",
|
||||
"name": "webapp",
|
||||
"l": "vs_webapp",
|
||||
"v": 10104
|
||||
},
|
||||
"formatted": false,
|
||||
"ext": "VRR.1",
|
||||
"svcReqL": [
|
||||
{
|
||||
"meth": "SubscrDetails",
|
||||
"req": {
|
||||
"subscrId": {{ subscription_id }},
|
||||
"userId": "{{ user_id }}"
|
||||
},
|
||||
"id": "1|6|"
|
||||
}
|
||||
]
|
||||
}
|
||||
61
zuginfo_playbooks/zuginfo_api_create_account.yml
Normal file
61
zuginfo_playbooks/zuginfo_api_create_account.yml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
---
|
||||
|
||||
- name: "Zuginfo.nrw API"
|
||||
hosts: localhost
|
||||
vars:
|
||||
unix_time_millis: "1762342729099"
|
||||
#aid: ""
|
||||
#mysterious_id: ""
|
||||
|
||||
tasks:
|
||||
- name: "Get AID (Token)"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/config/webapp.config.json?v={{ unix_time_millis }}"
|
||||
method: GET
|
||||
register: token
|
||||
when: aid is undefined
|
||||
|
||||
- name: "Print AID (Token)"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ token }}"
|
||||
|
||||
- set_fact:
|
||||
aid: "{{ token.json.hciAuth.aid }}"
|
||||
when: aid is undefined
|
||||
|
||||
- name: "Get Mysterious ID"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId=undefined&hciMethod=ServerInfo&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','mysterious_id.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
register: get_mysterious_id
|
||||
when: mysterious_id is undefined
|
||||
|
||||
- name: "Print Mysterious ID"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ get_mysterious_id }}"
|
||||
|
||||
- set_fact:
|
||||
mysterious_id: "{{ get_mysterious_id.json.id }}"
|
||||
when: mysterious_id is undefined
|
||||
|
||||
- name: "Unknown Request"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrUserDetails&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','account_or_whatever.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
register: account_whatever
|
||||
|
||||
- name: "Print Result of Unknown Request"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ account_whatever }}"
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
---
|
||||
|
||||
- name: "Zuginfo.nrw API"
|
||||
hosts: localhost
|
||||
vars:
|
||||
unix_time_millis: "1762342729099"
|
||||
push_endpoint: ""
|
||||
push_key_auth: ""
|
||||
push_key_p256dh: ""
|
||||
aid: ""
|
||||
mysterious_id: ""
|
||||
|
||||
tasks:
|
||||
- name: "Create WebPush Subscription"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrUserCreate&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','create_webpush_subscription.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
register: webpush_subscription
|
||||
|
||||
- name: "Create WebPush Subscription"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ webpush_subscription }}"
|
||||
|
||||
- set_fact:
|
||||
user_id: "{{ webpush_subscription.json.svcResL[0].res.userId }}"
|
||||
|
||||
- name: "Get a Channel ID"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrUserDetails&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','get_channel_id.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
register: channel_id
|
||||
|
||||
- name: "channel_id"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ channel_id }}"
|
||||
|
||||
- set_fact:
|
||||
channel_id: "{{ channel_id.json.svcResL[0].res.availableChannels[0].channelId }}"
|
||||
|
||||
- name: "Subscribe to info for S4"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrCreate&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','subscription_s4.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
TE: trailers
|
||||
register: subscribe_s4
|
||||
|
||||
- name: "subscribe_s4"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ subscribe_s4 }}"
|
||||
|
||||
- set_fact:
|
||||
subscription_id: "{{ subscribe_s4.json.svcResL[0].res.subscrId }}"
|
||||
|
||||
- name: "Verify Subscription"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrDetails&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','verify_subscription.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
TE: trailers
|
||||
register: verify_subscription
|
||||
|
||||
- name: "Result: Verify Subscription"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ verify_subscription }}"
|
||||
27
zuginfo_playbooks/zuginfo_api_delete_account.yml
Normal file
27
zuginfo_playbooks/zuginfo_api_delete_account.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
|
||||
- name: "Zuginfo.nrw API"
|
||||
hosts: localhost
|
||||
vars:
|
||||
unix_time_millis: "1762342729099"
|
||||
aid: ""
|
||||
mysterious_id: ""
|
||||
user_id: ""
|
||||
|
||||
tasks:
|
||||
- name: "Delete Account"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrUserDelete&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','delete_account.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
TE: trailers
|
||||
register: delete_account
|
||||
|
||||
- name: "Print Result of Account Deletion"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ delete_account }}"
|
||||
28
zuginfo_playbooks/zuginfo_api_delete_subscription.yml
Normal file
28
zuginfo_playbooks/zuginfo_api_delete_subscription.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
|
||||
- name: "Zuginfo.nrw API"
|
||||
hosts: localhost
|
||||
vars:
|
||||
unix_time_millis: "1762342729099"
|
||||
aid: ""
|
||||
mysterious_id: ""
|
||||
subsciption_id: ""
|
||||
user_id: ""
|
||||
|
||||
tasks:
|
||||
- name: "Delete Subscription"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrDelete&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','delete_subscription.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
TE: trailers
|
||||
register: delete_subscription
|
||||
|
||||
- name: "Print Result of Deleting Subscription"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ delete_subscription }}"
|
||||
42
zuginfo_playbooks/zuginfo_api_list_subscriptions.yml
Normal file
42
zuginfo_playbooks/zuginfo_api_list_subscriptions.yml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
|
||||
- name: "Zuginfo.nrw API"
|
||||
hosts: localhost
|
||||
vars:
|
||||
unix_time_millis: "1762342729099"
|
||||
aid: ""
|
||||
mysterious_id: ""
|
||||
|
||||
tasks:
|
||||
- name: "List Subscriptions"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrSearch&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','list_subscriptions.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
TE: trailers
|
||||
register: list_subscription
|
||||
|
||||
- name: "Print Result: List of Subscriptions"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ list_subscription }}"
|
||||
|
||||
- name: "Detail Subscriptions"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrUserDetails&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','detail_subscriptions.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
register: detail_subscription
|
||||
|
||||
- name: "Print Result: Details of Subscriptions"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ detail_subscription }}"
|
||||
46
zuginfo_playbooks/zuginfo_api_subscribe_s4.yml
Normal file
46
zuginfo_playbooks/zuginfo_api_subscribe_s4.yml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
|
||||
- name: "Zuginfo.nrw API"
|
||||
hosts: localhost
|
||||
vars:
|
||||
unix_time_millis: "1762342729099"
|
||||
aid: ""
|
||||
mysterious_id: ""
|
||||
|
||||
tasks:
|
||||
- name: "Subscribe to info for S4"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrCreate&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','subscription_s4.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
TE: trailers
|
||||
register: subscribe_s4
|
||||
|
||||
- name: "Print Result: Subscribe to S4"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ subscribe_s4 }}"
|
||||
|
||||
- set_fact:
|
||||
subscription_id: "{{ subscribe_s4.json.svcResL[0].res.subscrId }}"
|
||||
|
||||
- name: "Verify Subscription"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrDetails&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','verify_subscription.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
TE: trailers
|
||||
register: verify_subscription
|
||||
|
||||
- name: "Print Result: Verify Subscription"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ verify_subscription }}"
|
||||
25
zuginfo_playbooks/zuginfo_api_update_subscription.yml
Normal file
25
zuginfo_playbooks/zuginfo_api_update_subscription.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
|
||||
- name: "Zuginfo.nrw API"
|
||||
hosts: localhost
|
||||
vars:
|
||||
unix_time_millis: "1762342729099"
|
||||
aid: ""
|
||||
mysterious_id: ""
|
||||
|
||||
tasks:
|
||||
- name: "Update Subscription (no messages on S4 concerning Sundays)"
|
||||
ansible.builtin.uri:
|
||||
url: "https://www.zuginfo.nrw/gate/?requestId={{ mysterious_id }}&hciMethod=SubscrUpdate&hciVersion=1.24&hciClientType=WEB&hciClientVersion=10104&aid={{ aid }}&rnd={{ unix_time_millis }}"
|
||||
method: POST
|
||||
body: "{{ lookup('ansible.builtin.template','update_subscription.json.j2') }}"
|
||||
headers:
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
Content-Type: application/json
|
||||
Origin: https://www.zuginfo.nrw/
|
||||
Referer: https://www.zuginfo.nrw/
|
||||
register: update_subscription
|
||||
|
||||
- name: "Print Result of Updating Subscription"
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ update_subscription }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue