Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P73477
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Ladsgroup
on Feb 14 2025, 12:16 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Tags
None
Referenced Files
F58398650: raw-paste-data.txt
Feb 14 2025, 12:16 PM
2025-02-14 12:16:24 (UTC+0)
Subscribers
None
import
pymysql.cursors
import
json
import
time
db_name
=
'dewiktionary'
with
open
(
'dewiktionary'
,
'r'
)
as
f
:
oldids
=
f
.
read
()
.
split
(
'
\n
'
)
with
open
(
'dewiktionary_mapping'
,
'r'
)
as
f
:
mapping
=
json
.
loads
(
f
.
read
())
c
=
0
bin_log
=
{}
tt
=
None
addr
=
None
flags
=
None
with
open
(
'deletions_T386162'
,
'r'
)
as
f
:
for
line
in
f
:
c
+=
1
if
line
.
startswith
(
'--'
):
bin_log
[
'tt:'
+
str
(
tt
)]
=
{
'addr'
:
'es:'
+
addr
[
1
:
-
1
],
'flags'
:
flags
[
1
:
-
1
]
.
replace
(
'external,'
,
''
)}
tt
=
None
addr
=
None
flags
=
None
if
line
.
startswith
(
'### @1='
):
if
tt
:
print
(
'broken1'
)
break
tt
=
int
(
line
.
split
(
'### @1='
)[
1
]
.
split
(
'/*'
)[
0
]
.
strip
())
if
line
.
startswith
(
'### @2='
):
if
addr
:
print
(
'broken2'
)
break
addr
=
line
.
split
(
'### @2='
)[
1
]
.
split
(
'/*'
)[
0
]
.
strip
()
if
line
.
startswith
(
'### @3='
):
if
flags
:
print
(
'broken3'
)
break
flags
=
line
.
split
(
'### @3='
)[
1
]
.
split
(
'/*'
)[
0
]
.
strip
()
for
oldid
in
mapping
:
if
oldid
not
in
bin_log
:
continue
for
content_id
in
mapping
[
oldid
]:
addr
=
bin_log
[
oldid
][
'addr'
]
flags
=
bin_log
[
oldid
][
'flags'
]
if
"'"
in
addr
or
"'"
in
flags
:
continue
if
flags
.
endswith
(
',external'
):
flags
=
flags
.
replace
(
',external'
,
''
)
if
'external'
in
flags
:
print
(
flags
)
continue
a
=
f
'UPDATE /* {oldid} */ content set content_address =
\'
{addr}?flags={flags}
\'
where content_id = {content_id}; select sleep(0.1);'
print
(
a
)
Event Timeline
Ladsgroup
created this paste.
Feb 14 2025, 12:16 PM
2025-02-14 12:16:24 (UTC+0)
Ladsgroup
mentioned this in
T386162: Some dewiktionary pageviews fatal "RevisionAccessException: Failed to load data blob from {address} for revision {revision}."
.
Feb 14 2025, 12:20 PM
2025-02-14 12:20:35 (UTC+0)
Log In to Comment