cvzi / Youtube-Genius-Lyrics-userscript

Userscript, Show lyrics/songtexts from genius.com on Youtube next to music videos
https://greasyfork.org/en/scripts/386259-youtube-genius-lyrics
GNU General Public License v3.0
40 stars 6 forks source link

SyntaxError: Unexpected token #56

Closed estherflails closed 1 year ago

estherflails commented 1 year ago

This userscript doesn't work for me. I sometimes get this error when I open a video and the lyrics never show up like in the screenshots. Clicking on the "Show lyrics" button in Tampermonkey does nothing. I tried disabling all Chrome extensions in case one of them interfered somehow but that doesn't seem to be the case.

image

cvzi commented 1 year ago

Can you please try to copy the whole message that appears and paste it here

estherflails commented 1 year ago

I tried to, but it seems to suddenly work now :) I didn't do anything so I assume it's on your end. Thank you! :D

cvzi commented 1 year ago

I didn't do anything either. I think is just a temporary problem that occasionally happens. Maybe it is some kind of network problem at genius.com. Maybe Cloudflare DDoS protection or anti-bot captchas.

Someone else has reported the same problem previously and it also resolved for them before the could post the whole message. If it happens again, please try to copy the whole message or try to make a screenshot of the rest of the message as well, thanks!

estherflails commented 1 year ago

1 2 3 4

The text is unfortunately not copyable, but I was able to get some screenshots. :) Hope you find this useful!

cvzi commented 1 year ago

Unfortunately it doesn't really help. I am still clueless why it happens.

I will try to change the script so that it will show a more helpful error message.

cyfung1031 commented 1 year ago

@estherflails

1. Can you click this link and screen capture its content? https://genius.com/api/search/song?page=1&q=Mother%20Mother%20It%27s%20Alright

2. After that error message showed, reload the page. Will the lyrics show again (become normal)?

3. Did you try Violentmonkey?

estherflails commented 1 year ago

{"meta":{"status":200},"response":{"sections":[{"type":"song","hits":[{"highlights":[],"index":"song","type":"song","result":{"_type":"song","annotation_count":10,"api_path":"/songs/3986307","artist_names":"Mother Mother","full_title":"It's Alright by Mother Mother","header_image_thumbnail_url":"https://images.genius.com/6ad5bce742baa68e96fad75dcd3067e1.300x300x1.jpg","header_image_url":"https://images.genius.com/6ad5bce742baa68e96fad75dcd3067e1.953x953x1.jpg","id":3986307,"instrumental":false,"language":"en","lyrics_owner_id":5389755,"lyrics_state":"complete","lyrics_updated_at":1674873691,"path":"/Mother-mother-its-alright-lyrics","pyongs_count":12,"relationships_index_url":"https://genius.com/Mother-mother-its-alright-sample","release_date_components":{"year":2018,"month":11,"day":2},"release_date_for_display":"November 2, 2018","release_date_with_abbreviated_month_for_display":"Nov. 2, 2018","song_art_image_thumbnail_url":"https://images.genius.com/6ad5bce742baa68e96fad75dcd3067e1.300x300x1.jpg","song_art_image_url":"https://images.genius.com/6ad5bce742baa68e96fad75dcd3067e1.953x953x1.jpg","stats":{"unreviewed_annotations":10,"hot":false,"pageviews":64279},"title":"It’s Alright","title_with_featured":"It's Alright","updated_by_human_at":1628709088,"url":"https://genius.com/Mother-mother-its-alright-lyrics","featured_artists":[],"primary_artist":{"_type":"artist","api_path":"/artists/26948","header_image_url":"https://images.genius.com/1f5cbb247ed83c206b8af964016b0471.1000x521x1.jpg","id":26948,"image_url":"https://images.genius.com/72f7d44810cebe7e0d95a808d4ea5951.339x339x1.png","index_character":"m","is_meme_verified":false,"is_verified":false,"name":"Mother Mother","slug":"Mother-mother","url":"https://genius.com/artists/Mother-mother"}}},{"highlights":[],"index":"song","type":"song","result":{"_type":"song","annotation_count":0,"api_path":"/songs/7721103","artist_names":"Mother Mother","full_title":"It’s Alright (Acoustic) by Mother Mother","header_image_thumbnail_url":"https://images.genius.com/72f7d44810cebe7e0d95a808d4ea5951.300x300x1.png","header_image_url":"https://images.genius.com/72f7d44810cebe7e0d95a808d4ea5951.339x339x1.png","id":7721103,"instrumental":false,"language":"en","lyrics_owner_id":15224477,"lyrics_state":"complete","lyrics_updated_at":1645266706,"path":"/Mother-mother-its-alright-acoustic-lyrics","pyongs_count":null,"relationships_index_url":"https://genius.com/Mother-mother-its-alright-acoustic-sample","release_date_components":{"year":2019,"month":4,"day":3},"release_date_for_display":"April 3, 2019","release_date_with_abbreviated_month_for_display":"Apr. 3, 2019","song_art_image_thumbnail_url":"https://images.genius.com/72f7d44810cebe7e0d95a808d4ea5951.300x300x1.png","song_art_image_url":"https://images.genius.com/72f7d44810cebe7e0d95a808d4ea5951.339x339x1.png","stats":{"unreviewed_annotations":0,"hot":false},"title":"It’s Alright (Acoustic)","title_with_featured":"It’s Alright (Acoustic)","updated_by_human_at":1651839571,"url":"https://genius.com/Mother-mother-its-alright-acoustic-lyrics","featured_artists":[],"primary_artist":{"_type":"artist","api_path":"/artists/26948","header_image_url":"https://images.genius.com/1f5cbb247ed83c206b8af964016b0471.1000x521x1.jpg","id":26948,"image_url":"https://images.genius.com/72f7d44810cebe7e0d95a808d4ea5951.339x339x1.png","index_character":"m","is_meme_verified":false,"is_verified":false,"name":"Mother Mother","slug":"Mother-mother","url":"https://genius.com/artists/Mother-mother"}}}]}],"next_page":2}}

2, I can't test this right now because currently it's working but I'll test if the error comes back.

3, No, I always use Tampermonkey. If the error comes back and 2, doesn't fix it I can give it a try if you think it would work.

Edit: I didn't check if I had the error before 1., I don't know if that makes a difference for the code I pasted here but I'll edit this comment if I can copy it when the error comes back.

Edit 2: The result of 1. is always the same. After reloading the page it doesn't show the error anymore but it also doesn't load the lyrics, even if I open the Tampermonkey menu and click on the 'Show Lyrics' button. I also tried Violentmonkey but it still gives the error.

cvzi commented 1 year ago

I am able to reproduce the error with a VPN (Tunnelbear from a Brazilian server)

Once the captcha on genius.com is solved, it sets a Cloudflare cookie. Afterwards the script seems to work normally.

I added a hint to the script:

screenshot1