Fix media previews
This commit is contained in:
parent
b3341b49c0
commit
2091f26bda
@ -186,7 +186,7 @@ async fn main() -> tide::Result<()> {
|
||||
.get(|req| handler(req, "https://emoji.redditmedia.com/{}/{}", vec!["id", "name"]));
|
||||
app
|
||||
.at("/preview/:loc/:id/:query/")
|
||||
.get(|req| handler(req, "https://{}preview.redd.it/{}?{}", vec!["loc", "id", "query"]));
|
||||
.get(|req| handler(req, "https://{}view.redd.it/{}?{}", vec!["loc", "id", "query"]));
|
||||
app
|
||||
.at("/style/*path/") /* */
|
||||
.get(|req| handler(req, "https://styles.redditmedia.com/{}", vec!["path"]));
|
||||
|
@ -208,8 +208,8 @@ pub fn format_url(url: &str) -> String {
|
||||
"a.thumbs.redditmedia.com" => capture(r"https://a\.thumbs\.redditmedia\.com/(.*)", "/thumb/a/", 1),
|
||||
"b.thumbs.redditmedia.com" => capture(r"https://b\.thumbs\.redditmedia\.com/(.*)", "/thumb/b/", 1),
|
||||
"emoji.redditmedia.com" => capture(r"https://emoji\.redditmedia\.com/(.*)/(.*)", "/emoji/", 2),
|
||||
"preview.redd.it" => capture(r"https://preview\.redd\.it/(.*)\?(.*)", "/preview//", 2),
|
||||
"external-preview.redd.it" => capture(r"https://external\-preview\.redd\.it/(.*)\?(.*)", "/preview/external-/", 2),
|
||||
"preview.redd.it" => capture(r"https://preview\.redd\.it/(.*)\?(.*)", "/preview/pre/", 2),
|
||||
"external-preview.redd.it" => capture(r"https://external\-preview\.redd\.it/(.*)\?(.*)", "/preview/external-pre/", 2),
|
||||
"styles.redditmedia.com" => capture(r"https://styles\.redditmedia\.com/(.*)", "/style/", 1),
|
||||
"www.redditstatic.com" => capture(r"https://www\.redditstatic\.com/(.*)", "/static/", 1),
|
||||
_ => String::new(),
|
||||
|
Loading…
Reference in New Issue
Block a user