[1mdiff --git a/res/about/version.gmi b/res/about/version.gmi[m
[1mindex 8c88c024..0a430b58 100644[m
[1m--- a/res/about/version.gmi[m
[1m+++ b/res/about/version.gmi[m
[36m@@ -6,6 +6,9 @@[m
[m
[32m+[m[32m## 1.15.3[m
[32m+[m[32m* Fixed handling of redirects in the inline media player and file downloader.[m
[32m+[m
[1mdiff --git a/src/gmrequest.c b/src/gmrequest.c[m
[1mindex aaee50c0..3fe638d2 100644[m
[1m--- a/src/gmrequest.c[m
[1m+++ b/src/gmrequest.c[m
[36m@@ -1142,6 +1142,10 @@[m [miBool isFinished_GmRequest(const iGmRequest *d) {[m
return iTrue;[m
}[m
[m
[32m+[m[32miBool filtersEnabled_GmRequest(const iGmRequest *d) {[m
[32m+[m[32m return d->isFilterEnabled;[m
[32m+[m[32m}[m
[32m+[m
enum iGmStatusCode status_GmRequest(const iGmRequest *d) {[m
if (d) {[m
enum iGmStatusCode code;[m
[1mdiff --git a/src/gmrequest.h b/src/gmrequest.h[m
[1mindex 1ad4b7f3..634a7b62 100644[m
[1m--- a/src/gmrequest.h[m
[1m+++ b/src/gmrequest.h[m
[36m@@ -83,6 +83,7 @@[m [mvoid unlockResponse_GmRequest (iGmRequest *);[m
[m
uint32_t id_GmRequest (const iGmRequest ); / unique ID */[m
iBool isFinished_GmRequest (const iGmRequest *);[m
[32m+[m[32miBool filtersEnabled_GmRequest (const iGmRequest *);[m
enum iGmStatusCode status_GmRequest (const iGmRequest *);[m
const iString * meta_GmRequest (const iGmRequest *);[m
const iBlock * body_GmRequest (const iGmRequest *);[m
[1mdiff --git a/src/media.c b/src/media.c[m
[1mindex 57f126a2..f9ac0a2d 100644[m
[1m--- a/src/media.c[m
[1m+++ b/src/media.c[m
[36m@@ -641,6 +641,19 @@[m [mvoid deinit_MediaRequest(iMediaRequest *d) {[m
iRelease(d->req);[m
}[m
[m
[32m+[m[32mvoid resubmitWithUrl_MediaRequest(iMediaRequest *d, const iString *url) {[m
[32m+[m[32m iAssert(d->req);[m
[32m+[m[32m iAssert(isFinished_GmRequest(d->req));[m
[32m+[m[32m const iBool enableFilters = filtersEnabled_GmRequest(d->req);[m
[32m+[m[32m deinit_MediaRequest(d); /* release request, disconnect audiences */[m
[32m+[m[32m d->req = new_GmRequest(certs_App());[m
[32m+[m[32m setUrl_GmRequest(d->req, url);[m
[32m+[m[32m enableFilters_GmRequest(d->req, enableFilters);[m
[32m+[m[32m iConnect(GmRequest, d->req, updated, d, updated_MediaRequest_);[m
[32m+[m[32m iConnect(GmRequest, d->req, finished, d, finished_MediaRequest_);[m
[32m+[m[32m submit_GmRequest(d->req);[m
[32m+[m[32m}[m
[32m+[m
iMediaRequest *newReused_MediaRequest(iDocumentWidget *doc, unsigned int linkId,[m
iGmRequest *request) {[m
iMediaRequest *d = new_Object(&Class_MediaRequest);[m
[1mdiff --git a/src/media.h b/src/media.h[m
[1mindex 73ea9d83..0a818ec9 100644[m
[1m--- a/src/media.h[m
[1m+++ b/src/media.h[m
[36m@@ -124,5 +124,7 @@[m [mstruct Impl_MediaRequest {[m
iDeclareObjectConstructionArgs(MediaRequest, iDocumentWidget *doc, unsigned int linkId,[m
const iString *url, iBool enableFilters)[m
[m
[32m+[m[32mvoid resubmitWithUrl_MediaRequest (iMediaRequest *, const iString *url);[m
[32m+[m[41m [m
iMediaRequest * newReused_MediaRequest (iDocumentWidget *doc, unsigned int linkId,[m
iGmRequest *request);[m
[1mdiff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c[m
[1mindex 6fdac976..6e73a891 100644[m
[1m--- a/src/ui/documentwidget.c[m
[1m+++ b/src/ui/documentwidget.c[m
[36m@@ -3741,6 +3741,19 @@[m [mstatic iBool handleMediaCommand_DocumentWidget_(iDocumentWidget *d, const char *[m
refresh_Widget(as_Widget(d));[m
}[m
}[m
[32m+[m[32m else if (category_GmStatusCode(code) == categoryRedirect_GmStatusCode) {[m
[32m+[m[32m if (d->redirectCount++ < 5) {[m
[32m+[m[32m /* Redo the request. */[m
[32m+[m[32m iString *url = copy_String(meta_GmRequest(req->req));[m
[32m+[m[32m resubmitWithUrl_MediaRequest(req, url);[m
[32m+[m[32m delete_String(url);[m
[32m+[m[32m }[m
[32m+[m[32m else {[m
[32m+[m[32m const iGmError *err = get_GmError(tooManyRedirects_GmStatusCode);[m
[32m+[m[32m makeSimpleMessage_Widget(format_CStr(uiTextCaution_ColorEscape "%s", err->title), err->info);[m
[32m+[m[32m removeMediaRequest_DocumentWidget_(d, req->linkId);[m
[32m+[m[32m }[m
[32m+[m[32m }[m
else {[m
const iGmError *err = get_GmError(code);[m
makeSimpleMessage_Widget(format_CStr(uiTextCaution_ColorEscape "%s", err->title), err->info);[m
text/plain
This content has been proxied by September (ba2dc).