A
A
alex2021-10-05 18:51:55
Python
alex, 2021-10-05 18:51:55

How to read yandex cookies through python?

Faced this problem:

conn = sqlite3.connect('Cookies') #будем считать что файл "Сукис" уже в одной папке со скриптом
cursor = conn.cursor()
cursor.execute('SELECT host_key, name, value, encrypted_value FROM cookies WHERE name = "yandexuid"') #для тестов взял рандомный кук с домашней страницы яндекса
for host_key, name, value, encrypted_value in cursor.fetchall():
    print(host_key, name, value, encrypted_value)

Gives an error: sqlite3.OperationalError
: Could not decode to UTF-8 column 'encrypted_value' with text '*unreadable characters here * ' .ru yandexuid Apparently, the value field is empty, and encrypted_value contains encrypted characters that cannot be read just like that. So the question is: How to decrypt the encrypted_value?


Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jan, 2021-10-15
@Buchachalo

As far as I remember, cookies are not encrypted. Is there a chance that they are recorded in the database through one place?
Can you show the code what comes in response.cookies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question