A few years ago, Kinopoisk removed the ability to export user votes. This repository will help you with that.
Update the software.
sudo apt update && sudo apt upgrade -y
Install python
and pip
(python package manager).
sudo apt install python3.10 python3-pip
Install virtualenv
(python environments manager).
pip3 install virtualenv && source ~/.profile
Clone this repository and cd into it.
git clone https://github.com/mrguseinov-backups/kinopoisk.git && cd kinopoisk
Create a new virtual environment and activate it.
virtualenv .venv && source .venv/bin/activate
Install the required packages.
pip install -r requirements.txt
Go to the Kinopoisk website, sign in and navigate to the votes page, which looks something like:
https://www.kinopoisk.ru/user/<user_id>/votes/
Press F12
to open the DevTools, switch to the Network
tab, hit Ctrl+R
and filter by votes/
.
Right click the votes/
request, then Copy
and Copy as Node.js fetch
.
Create the headers.json
file in the project root, paste the copied content into it, and leave only the value from the headers
key. You should end up with something like the following:
{
"accept": "...",
"accept-language": "...",
"cache-control": "...",
"sec-ch-ua": "...",
"sec-ch-ua-mobile": "...",
"sec-ch-ua-platform": "...",
"sec-fetch-dest": "...",
"sec-fetch-mode": "...",
"sec-fetch-site": "...",
"sec-fetch-user": "...",
"upgrade-insecure-requests": "...",
"cookie": "...",
"Referer": "...",
"Referrer-Policy": "..."
}
Note that the headers.json
file must be kept secret!
Find out the total number of pages on the votes page. In the following screenshot, it's 2
.
Set the num_pages
variable in the app.py
file.
def main() -> None:
Downloader().download_vote_pages(num_pages=2)
Parser().parse_vote_pages()
Activate the virtual environment if it's not active.
source .venv/bin/activate
Run the app.py
file.
python app.py