Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
crossword
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Silas Dohm
crossword
Commits
67534b81
Commit
67534b81
authored
Mar 15, 2022
by
Silas Dohm
Browse files
Options
Downloads
Patches
Plain Diff
parser added
parent
22dbd24c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser_welt.py
+66
-0
66 additions, 0 deletions
parser_welt.py
with
66 additions
and
0 deletions
parser_welt.py
0 → 100644
+
66
−
0
View file @
67534b81
#%%
import
json
import
requests
# %%
from
Cryptodome
import
Random
from
Cryptodome.Cipher
import
AES
import
base64
from
hashlib
import
md5
BLOCK_SIZE
=
16
def
pad
(
data
):
length
=
BLOCK_SIZE
-
(
len
(
data
)
%
BLOCK_SIZE
)
return
data
+
(
chr
(
length
)
*
length
).
encode
()
def
unpad
(
data
):
return
data
[:
-
(
data
[
-
1
]
if
type
(
data
[
-
1
])
==
int
else
ord
(
data
[
-
1
]))]
def
bytes_to_key
(
data
,
salt
,
output
=
48
):
# extended from https://gist.github.com/gsakkis/4546068
assert
len
(
salt
)
==
8
,
len
(
salt
)
data
+=
salt
key
=
md5
(
data
).
digest
()
final_key
=
key
while
len
(
final_key
)
<
output
:
key
=
md5
(
key
+
data
).
digest
()
final_key
+=
key
return
final_key
[:
output
]
def
encrypt
(
message
,
passphrase
):
salt
=
Random
.
new
().
read
(
8
)
key_iv
=
bytes_to_key
(
passphrase
,
salt
,
32
+
16
)
key
=
key_iv
[:
32
]
iv
=
key_iv
[
32
:]
aes
=
AES
.
new
(
key
,
AES
.
MODE_CBC
,
iv
)
return
base64
.
b64encode
(
b
"
Salted__
"
+
salt
+
aes
.
encrypt
(
pad
(
message
)))
def
decrypt
(
encrypted
,
passphrase
):
encrypted
=
base64
.
b64decode
(
encrypted
)
assert
encrypted
[
0
:
8
]
==
b
"
Salted__
"
salt
=
encrypted
[
8
:
16
]
key_iv
=
bytes_to_key
(
passphrase
,
salt
,
32
+
16
)
key
=
key_iv
[:
32
]
iv
=
key_iv
[
32
:]
aes
=
AES
.
new
(
key
,
AES
.
MODE_CBC
,
iv
)
return
unpad
(
aes
.
decrypt
(
encrypted
[
16
:]))
password
=
"
9pSEhMHY8jOkTrSl46YgFWGIneUU
"
.
encode
()
#%%
for
month
in
range
(
12
):
for
day
in
range
(
1
,
32
):
try
:
url
=
"
https://dutyfarm.welt.de/kreuzwortraetsel-html5-new/data/
"
+
str
(
day
)
+
"
_
"
+
str
(
month
)
+
"
.cwr
"
t
=
requests
.
get
(
url
)
newDictionary
=
json
.
loads
(
t
.
text
)
for
i
in
range
(
len
(
newDictionary
)
-
1
):
#decrypt answers
newDictionary
[
i
][
"
answer
"
]
=
decrypt
(
newDictionary
[
i
][
"
answer
"
],
password
).
decode
(
"
utf-8
"
)
newDictionary
[
-
1
][
"
solution
"
]
=
decrypt
(
newDictionary
[
-
1
][
"
solution
"
],
password
).
decode
(
"
utf-8
"
)
newDictionary
[
-
1
][
"
solutiondate
"
]
=
decrypt
(
newDictionary
[
-
1
][
"
solutiondate
"
],
password
).
decode
(
"
utf-8
"
)
newDictionary
[
-
1
][
"
solutionname
"
]
=
decrypt
(
newDictionary
[
-
1
][
"
solutionname
"
],
password
).
decode
(
"
utf-8
"
)
with
open
(
"
archive_welt/
"
+
str
(
month
+
1
)
+
"
_
"
+
str
(
day
)
+
"
.json
"
,
"
w
"
)
as
outfile
:
json
.
dump
(
newDictionary
,
outfile
)
except
:
pass
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment