append data before and after text
-
hi eveybody,
i have m3u8 file like this:#EXTINF:5.005, seg-1-v1-a1.ts #EXTINF:5.000, seg-2-v1-a1.ts #EXTINF:5.000, seg-3-v1-a1.ts #EXTINF:5.000, seg-4-v1-a1.ts #EXTINF:5.000, seg-5-v1-a1.ts
and i need to add like this:
#EXTINF:5.005, https://psv157-1.344322vg.en/videos/-211737703/556755643/720/seg-1-v1-a1.ts?extra=N87rklN9X234fdgfdgeeWSD #EXTINF:5.000, https://psv157-1.344322vg.en/videos/-211737703/556755643/720/seg-2-v1-a1.ts?extra=N87rklN9X234fdgfdgeeWSD #EXTINF:5.000, https://psv157-1.344322vg.en/videos/-211737703/556755643/720/seg-3-v1-a1.ts?extra=N87rklN9X234fdgfdgeeWSD #EXTINF:5.000, https://psv157-1.344322vg.en/videos/-211737703/556755643/720/seg-4-v1-a1.ts?extra=N87rklN9X234fdgfdgeeWSD #EXTINF:5.000, https://psv157-1.344322vg.en/videos/-211737703/556755643/720/seg-5-v1-a1.ts?extra=N87rklN9X234fdgfdgeeWSD
i have regex for this, but my issue is with incremental number to each segment
my regex is:
find:(?-s)^(#EXTINF:.*\R)(.+)
replace:$1https://psv157-1.344322vg.en/videos/-211737703/556755643/720/seg-\d+-v1-a1.ts?extra=N87rklN9X234fdgfdgeeWSD$2
but this one does not work fine for incremental segments numbers
-
I think you’re overcomplicating it (or your mis-stating your problem).
Try this for the replace part:
$1https://psv157-1.344322vg.en/videos/-211737703/556755643/720/$2?extra=N87rklN9X234fdgfdgeeWSD
-
oh yes, you’re right (as usual)
thanks you for the tip! all the best
-
@namx3249 FYI, ffmpeg can read .m3u8 files directly.
ffmpeg -i https://assets.afcdn.com/video49/20210722/v_645516.m3u8 -codec copy v_645516.mp4
Example 30 second clip about mixing up a cool drink. 16.3 MB.
-
yes, i know ffmpeg but already tried for strange site and does not work
because from m3u8 to this site only segments are present but missing the full link (first) and token at the end (see my first post above), so ffmpeg don’t have link for its download