- Issue created by @miiimooo
- Merge request !2Issue #3463343 by miiimooo: Skip parse_url and parse_str if there is no query string or v param → (Open) created by miiimooo
- Status changed to Needs review
5 months ago 12:55pm 23 July 2024 - miiimooo Europe
I have replaced the whole youtube id detection code with what's used in video_embed_field and a patch from there to support youtube shorts https://www.drupal.org/project/video_embed_field/issues/3279789 💬 Support youtube shorts Needs work
This patch supports formats like
- Status changed to Postponed: needs info
5 months ago 2:13pm 28 July 2024 - 🇩🇪Germany stefan.korn Jossgrund
@miiimooo: Thanks for your feedback. Few questions though.
First the message you gave in the issue description is cut off. Could you maybe post full message?
I suppose this warning message does not affect every 8.3 setup. I tried with php 8.3.8 and this video https://youtu.be/hTWKbfoikeg?feature=shared - I do not experience the (any) warning message.
Can you give the url and exact setup that leads to the message on your end?
And regarding the code change for parsing the URL. I am open to change this like it is used in video_embed_field. But the change you proposed brings in more changes as far as I can tell. Could you explain your code?
That said, currently I can insert URL like
https://youtu.be/hTWKbfoikeg?feature=shared
https://www.youtube.com/watch?v=hTWKbfoikegThey work with youtube duration.
You proposed https://www.youtube.com/w/hTWKbfoikeg - but I suppose ombed media in core does not support this type of string, so seems not to make sense to support this via youtube duration.It's true that youtube shorts are currently not supported by youtube duration and they could and should be supported. But this could imho be solved with a lighter patch than the one you currently provided.
- Status changed to Needs review
4 months ago 3:07pm 24 August 2024 - 🇩🇪Germany stefan.korn Jossgrund
committed a change that adds support for YT shorts.
-
stefan.korn →
committed 5ef3110f on 1.0.x
Issue #3463343: Improve parsing of youtube id - support YT shorts
-
stefan.korn →
committed 5ef3110f on 1.0.x
- Status changed to Fixed
about 2 months ago 4:44pm 6 November 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- miiimooo Europe
@stefan.korn thanks for checking the patch. I agree that the patch is heavy. I have installed and tested now your version. With `error_reporting(E_ALL)` I get this
```
backtrace_error_handler(8192, 'parse_str(): Passing null to parameter #1 ($string) of type string is deprecated', '/app/web/modules/contrib/youtube_duration/src/Service/YoutubeDurationGetterService.php', 220)
parse_str(NULL, NULL) (Line: 220)
Drupal\youtube_duration\Service\YoutubeDurationGetterService->setVideoId() (Line: 135)
Drupal\youtube_duration\Service\YoutubeDurationGetterService->initDurationGetter(Object, Object) (Line: 94)
youtube_duration_media_presave(Object)
...
```I used this `https://www.youtube.com/shorts/EX5_5QVl_zA`
- 🇩🇪Germany stefan.korn Jossgrund
Thanks for testing and reporting deprecation notice, should surely not give this warning.
I have committed a change in the dev branch.