samuelclay / NewsBlur

NewsBlur is a personal news reader that brings people together to talk about the world. A new sound of an old instrument.
http://www.newsblur.com
MIT License
6.83k stars 996 forks source link

Android: YouTube thumbnail images are not shown (they are on website) #1538

Closed louis-pre closed 5 months ago

louis-pre commented 3 years ago

Android 11 App version 11.0.1

YouTube thumbnail images are left blank in the Android app's feed whereas they are displayed in the web interface. I can reproduce this behavior with every YouTube channel I have setup.

See screenshots: Web:

Screen Shot 2021-08-22 at 11 50 29 AM

Android: Screenshot_20210822-115012

samuelclay commented 3 years ago

Hey did you mean to assign this to me? Based on the web screenshot, I believe the API is sending an image_url. Here's a sample feed you can test out:

https://www.newsblur.com/site/8053687/zack-freedmans-youtube-videos

louis-pre commented 3 years ago

I have spent some time trying to debug it on my side, it seems like changing com.newsblur.domain.Story.YT_THUMB_PRE from http://img.youtube.com/vi/ to https://img.youtube.com/vi/ (HTTP to HTTPS) is enough to resolve it.

~I managed to test it using the list layout but couldn't test with the grid layout because it is crashing on my side.~ ~My guess is that the GitHub codebase does not include the 11.0.1 fixes mentioned in the Play Store's changelogs.~

edit: I realized later that those changes are not on the master branch, sorry 😅

sictiru commented 3 years ago

@louis-pre Yes that is the cause, Android API 28+ expects only secure connections via HTTPS.

tesar-tech commented 10 months ago

Hello. I have the exact same issue on my Android ver13 and app version 13.1.2. I am new user, so I don't know if this issue was there also on older versions. image

I tried multiple feeds, multiple sizes of grid and thumbnail. Just cannot make it work. For non-youtube feeds it works, on web for yt it also works.

Thanks for the support, I am available to provide more info if needed!

mbhkoay commented 7 months ago

Appreciate if the changes can be pushed to the android app.

@louis-pre Yes that is the cause, Android API 28+ expects only secure connections via HTTPS.

sictiru commented 7 months ago

@samuelclay Could these thumbnails be parsed on the backend with https or is there a way the url can be mapped to the secure images in the story response?

samuelclay commented 6 months ago

The thumbnails come from the story text, so the url should match one of the secure image urls.

        {
            "story_hash": "8053687:c0c973",
            "story_tags": [],
            "story_date": "2024-02-13 16:00:18",
            "story_timestamp": "1707840018",
            "story_authors": "Zack Freedman",
            "story_title": "3D Printing a CHOCOLATE GRIDFINITY of LOVE!!",
            "story_content": "<div><div class=\"NB-youtube-player\">\n                            <iframe allowfullscreen=\"true\" src=\"https://www.youtube.com/embed/JlylupVEwRM?iv_load_policy=3\"/>\n                         </div>\n                         <div class=\"NB-youtube-stats\"><small>\n                             <b>From:</b> <a href=\"https://www.youtube.com/channel/UCUW49KGPezggFi0PGyDvcvg\">Zack Freedman</a><br/>\n                             <b>Duration:</b> 24:12<br/>\n                         </small></div><hr/>\n                         <div class=\"NB-youtube-description\"><p>I ate a Benchy! And a Patron!<br/>Try Brilliant free for 30 days! <a href=\"https://brilliant.org/zackfreedman\">https://brilliant.org/zackfreedman</a></p>\n\n<p>Thanks Cookiecad for the glorious PETG! <a href=\"https://amzn.to/3uAocBp\">https://amzn.to/3uAocBp</a></p>\n\n<p>Support the dumbest projects you can possibly imagine: <a href=\"https://patreon.com/zackfreedman\">https://patreon.com/zackfreedman</a><br/>Meet the smartest makers you can possibly imagine: <a href=\"https://discord.gg/voidstarlab\">https://discord.gg/voidstarlab</a></p>\n\n<p>I printed a Gridfinity out of chocolate and gave it to Brooke for Valentine's Day. Normally I try to add more details here in the description, but that kinda sums it up. I came, I saw, I ate a boat.</p>\n\n<p>Community projects featured:<br/>&#129521;Gridfinity Parametric Web Generator by Vector76: <a href=\"https://vector76.github.io/Web_OpenSCAD_Customizer/gridfinity_bins.html\">https://vector76.github.io/Web_OpenSCAD_Customizer/gridfinity_bins.html</a><br/>&#128141;Gridfinity Ring Holder by Link the Cat - <a href=\"https://thangs.com/designer/Link%20The%20Cat/3d-model/Gridfinity%20Ring%20Holder-586443?utm_source=youtube&amp;utm_medium=video&amp;utm_campaign=zack_f\">https://thangs.com/designer/Link%20The%20Cat/3d-model/Gridfinity%20Ring%20Holder-586443?utm_source=youtube&amp;utm_medium=video&amp;utm_campaign=zack_f</a> <br/>&#128171;Fidget Spinner One Piece Print by Muzz64 mmf.io/o/33162<br/>&#128367;&#65039;Gridfinity for Tea Candle by SteveW91 <a href=\"https://www.printables.com/model/293512-gridfinity-for-tea-candle/files\">https://www.printables.com/model/293512-gridfinity-for-tea-candle/files</a><br/>&#127795;Joint Holder 2x1 by Propella <a href=\"https://than.gs/m/62103?utm_source=youtube&amp;utm_medium=video&amp;utm_campaign=zack_f\">https://than.gs/m/62103?utm_source=youtube&amp;utm_medium=video&amp;utm_campaign=zack_f</a> <br/>&#127862;Gridfinity Bottle by NKCVic <a href=\"https://than.gs/m/62763?utm_source=youtube&amp;utm_medium=video&amp;utm_campaign=zack_f\">https://than.gs/m/62763?utm_source=youtube&amp;utm_medium=video&amp;utm_campaign=zack_f</a> <br/>&#127754;Gridfinity 3D benchy stand by Emboli <a href=\"https://www.printables.com/model/369592-gridfinity-3d-benchy-stand\">https://www.printables.com/model/369592-gridfinity-3d-benchy-stand</a><br/>&#9729;&#65039;Benchy Steam Puff by <a href=\"https://www.printables.com/model/360780-benchy-steam-puff\">https://www.printables.com/model/360780-benchy-steam-puff</a></p>\n\n<p>Timetable:<br/>00:00-00:40 What Hath I Wrought<br/>00:40-02:06 Thanks Brilliant<br/>02:06-04:21 Why are Chocolate Printers<br/>04:21-07:29 You Go Glen Cocoa<br/>07:29-08:39 What We're Printing<br/>08:39-10:42 Chocolate Sucks for Printing<br/>10:42-12:20 Printing Chocolate Gridfinity<br/>12:20-15:34 The Build, Part 1<br/>15:34-16:23 The Baseplate (not chocolate)<br/>16:23-19:43 The Build, Part 2<br/>19:43-24:11 Showing Brooke and Thanking You</p>\n\n<p>Credits:<br/>\"frosting\" (MakerBot Cupcake footage) by ugpdotorg <a href=\"https://www.youtube.com/watch?v=bzmtGRrNcJ0\">https://www.youtube.com/watch?v=bzmtGRrNcJ0</a> <br/>\"Cupcake CNC - Starting a Print\" by MakerBot <a href=\"https://www.youtube.com/watch?v=4jPKEJ5hQuI\">https://www.youtube.com/watch?v=4jPKEJ5hQuI</a> <br/>\"Cocoa Press 3D Chocolate Printer\" by Cocoa Press <br/><a href=\"https://www.youtube.com/watch?v=V4dtT5sHtm8\">https://www.youtube.com/watch?v=V4dtT5sHtm8\"6</a> Advanced FDM 3D Printing Tips When Adding Metal Parts to Your Build\" by TriMech <a href=\"https://www.youtube.com/watch?v=rk6MkW1eRiY\">https://www.youtube.com/watch?v=rk6MkW1eRiY</a><br/>\"Roundabout\" by Yes &#169;&#65039; Rhino/Elektra<br/>\"Forty Percent Leadbelly\" &#169;&#65039; 20th Television Animation and The Curiosity Company<br/>&#8220;Chocolate with Nuts&#8221; &#169;&#65039;Nickelodeon and United Plankton Pictures<br/>Power-up SFX: I couldn't find the rightsholder. Remixed from Epic Meal Time.<br/>Interference SFX: Partners in Rhyme<br/>Other SFX: <a href=\"http://www.zapsplat.com\">www.zapsplat.com</a></p></div>\n                         <img src=\"https://i.ytimg.com/vi/JlylupVEwRM/maxresdefault.jpg\" style=\"display:none\"/></div>",
            "story_permalink": "http://www.youtube.com/watch?v=JlylupVEwRM",
            "image_urls": [
                "https://img.youtube.com/vi/JlylupVEwRM/0.jpg",
                "https://i.ytimg.com/vi/JlylupVEwRM/maxresdefault.jpg"
            ],
            "secure_image_urls": {
                "https://img.youtube.com/vi/JlylupVEwRM/0.jpg": "/imageproxy/sc,sz5b3niqNyePL_UUnjEZeXoNi-G8uveb2kxRYGiRreug=/https://img.youtube.com/vi/JlylupVEwRM/0.jpg",
                "https://i.ytimg.com/vi/JlylupVEwRM/maxresdefault.jpg": "/imageproxy/sc,s2xIr8K5mmhwFyJ618PRjnvWAy0uB6TNWpX0nEfbC6do=/https://i.ytimg.com/vi/JlylupVEwRM/maxresdefault.jpg"
            },
            "secure_image_thumbnails": {
                "https://img.youtube.com/vi/JlylupVEwRM/0.jpg": "/imageproxy/192,sc,sz5b3niqNyePL_UUnjEZeXoNi-G8uveb2kxRYGiRreug=/https://img.youtube.com/vi/JlylupVEwRM/0.jpg",
                "https://i.ytimg.com/vi/JlylupVEwRM/maxresdefault.jpg": "/imageproxy/192,sc,s2xIr8K5mmhwFyJ618PRjnvWAy0uB6TNWpX0nEfbC6do=/https://i.ytimg.com/vi/JlylupVEwRM/maxresdefault.jpg"
            },
sictiru commented 6 months ago

OK I found the issue on the client side. I'll close the ticket once it's live in the next release.

Screenshot_2024-02-23-11-54-47-86_5d2ddf53a3076d2dff44d407a40d3e5e

VlaK0r commented 5 months ago

OK I found the issue on the client side. I'll close the ticket once it's live in the next release.

Hello! Please tell me how did you manage to solve the problem?

sictiru commented 5 months ago

@VlaK0r The url sniff wasn't using https. You can check the commit above. Fix live in v13.2.3