https://api2.musical.ly/aweme/v1/playwm/?video_id=v07025790000bpagqcvhpliigi473f4g
to
use
addMediaFromUrl("https://api2.musical.ly/aweme/v1/playwm/?video_id=v07025790000bpagqcvhpliigi473f4g")
return file playwm.x-empty
How to fix this problem?
Hi,
The addMediaFromUrl function needs to use HTTP context options. Three quick ways for adding this feature:
by adding a new config option. We can override and revert the config at runtime (for example for cases when some urls require autentication). It`s not nice, but avoids the breaking change in option 2.
by adding a new $httpContext param in the addMediaFromUrl function (it will be a breaking change though)
public function addMediaFromUrl(string $url, array $httpContext = null, ...$allowedMimeTypes): FileAdder
{
if (! $stream = @fopen($url, 'r', false, $httpContext)) {
throw UnreachableUrl::create($url);
}
...
@tnduc Until this feature is available, you can simply override the InteractsWithMedia trait addMediaFromUrl function and use the approach in options 2 above.
Most helpful comment
Hi,
The addMediaFromUrl function needs to use HTTP context options. Three quick ways for adding this feature:
by adding a new config option. We can override and revert the config at runtime (for example for cases when some urls require autentication). It`s not nice, but avoids the breaking change in option 2.
by adding a new $httpContext param in the addMediaFromUrl function (it will be a breaking change though)
@tnduc Until this feature is available, you can simply override the InteractsWithMedia trait addMediaFromUrl function and use the approach in options 2 above.