Skip to content

ReVanced/restore-missing-youtube-watch-history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


                       

Continuing the legacy of Vanced

⌛ Restore missing YouTube watch history

Script to import missing YouTube watch history

❓ About

This script is used to restore the missing YouTube watch history if you used the ReVanced Client spoof patch for YouTube.
Please remember that it is not meant to be a general-purpose tool for recording watch history. It has specialized functionality for ReVanced to recover from the incident when watch history has disappeared.

⚠️ Disclaimer

Warning

If you need help, you can visit our links at revanced.app or join our Discord.

Do NOT use the image channel. Instead use the image channel

Warning

This script automates your YouTube account, which is not in terms of YouTube's service. Use this script with caution.

✅ Usage

To learn how to use the script and restore your history, follow the steps for your OS:

Windows
  1. Install the latest Python from Microsoft Store or python.org.

  2. Download the project and extract the ZIP somewhere

    image

  3. Open CMD in the directory where main.py is located

    image

  4. install the required packages and update yt-dlp

    python -m pip install -r requirements.txt
    python -m pip install --upgrade yt-dlp

    image

  5. Go to Google Takeout

  6. Only tick "YouTube and YouTube Music"

    image image

  7. Change "Multiple formats" to "JSON" (only for "history")

    image image

  8. Untick everything in "All YouTube data included" except "history"

    image

  9. Click "Next step"

    image

  10. Leave everything as is and click "Create export"

    image

After that, you will receive an email with a link to download your history. Download it. You will find a file called watch-history.json in the downloaded zip file inside "YouTube and YouTube Music/history". Place watch-history.json in the same directory as main.py.

image

Make sure you are logged into YouTube in your browser. By default, the script will use Chrome. If you use a different browser, use the --help option when you run main.py to select your browser.

image

Run the script:

⚠️ Warning
Make sure your browser does not run. Neither in the foreground nor in the background (See Task Manager), otherwise, you may get a permission error when running the script.

python main.py

ℹ️ Note
You can use the --help option to see all available options.

Credits to @guillaumematheron for the original script.

📜 License

"Restore missing YouTube watch history" is licensed under the GPLv3 license. Please see the license file for more information. tl;dr you may copy, distribute and modify "Restore missing YouTube watch history" as long as you track changes/dates in source files. Any modifications to "Restore missing YouTube watch history" must also be made available under the GPL, along with build & install instructions.