In 2019, YouTube updated its layout dubbed the "polymer layout." Because of this, the HTML structure changed and the spider no longer functions correctly. However, I have found two workarounds.
-
According to this thread post, you can modify your cookies to include &f6=8 on the PREF cookie's value to revert the page structure back to the pre-2019 layout. Modifying the cookies in youtube_cookies.json to include this works as expected and the spider crawls through the history successfully.
-
Adding the GET parameter disable_polymer=1 to any YouTube URL reverts the page back to the old layout. However, this does not carry over when clicking on links, as it defaults back to the new layout. Modifying the start_url variable in youtube_history_spider.py to have ?disable_polymer=1 at the end successfully returns the first history page, but prematurely ends the crawl.
I'm sure the code can be modified to support the new layout, but I'm not sure how much work that could be. Additionally, while the first workaround is the easiest to do, it may not work forever. ¯\_(ツ)_/¯ Great project though, love it!
In 2019, YouTube updated its layout dubbed the "polymer layout." Because of this, the HTML structure changed and the spider no longer functions correctly. However, I have found two workarounds.
According to this thread post, you can modify your cookies to include
&f6=8on thePREFcookie's value to revert the page structure back to the pre-2019 layout. Modifying the cookies inyoutube_cookies.jsonto include this works as expected and the spider crawls through the history successfully.Adding the GET parameter
disable_polymer=1to any YouTube URL reverts the page back to the old layout. However, this does not carry over when clicking on links, as it defaults back to the new layout. Modifying thestart_urlvariable in youtube_history_spider.py to have?disable_polymer=1at the end successfully returns the first history page, but prematurely ends the crawl.I'm sure the code can be modified to support the new layout, but I'm not sure how much work that could be. Additionally, while the first workaround is the easiest to do, it may not work forever. ¯\_(ツ)_/¯ Great project though, love it!