Closed isamert closed 5 years ago
Hi,
I sympathise with your problem, but I doubt I will find the time to work on this personally because it's such a niche request. Here's how I think you could go about it if you want to get your hands dirty:
https://github.com/michael-lazar/rtv/blob/master/rtv/content.py#L241
Replace
data['url_full'] = sub.url
with
try:
data['url_full'] = sub.preview['images'][0]['source']['url']
except (AttributeError, ValueError, TypeError):
data['url_full'] = sub.url
Of course, the devil is in the details and you would still need to properly handle videos, links to other media types, links to external images, etc.
Thank you! As I mentioned, I only need to replace "i.redd.it" with previews so I just checked for them instead of replacing all the links with previews and it seems to work for me. I don't expect this feature in upstream but at least if anyone needs something like this, presence of this issue may help them. Thanks again for this great project!
I want to use
preview.redd.it
images instead ofi.redd.it
links. I tried to rewrite the image link thatrtv
hands over to my script but that does not work, I'm gettingError 403 Forbidden
error. Here is a randomi.redd.it
image:And here is the
preview.redd.it
counterpart:So rewriting the url
https://i.redd.it/fja0oxrr90h21.jpg
intohttps://preview.redd.it/fja0oxrr90h21.jpg
does not work aspreview.redd.it
requires some extra parameters. (Actually the link won't work besides the original parameters, even changingwidth
parameter gives an error.) That means previews needs to be requested explicitly, as far as I understand. Is there a way to accomplish this in rtv or can you add it as an option?Rationale: I'm living in Turkey and
i.redd.it
is blocked butpreview.redd.it
works without problems (or at least it works with simple DNS change). More interestingly, after loading an image troughpreview.redd.it
I can also open it in full resolution ini.redd.it
in same browser session. This may seem like a very niche use-case but I believe it will help a lot of people.