Community
    • Login

    append data before and after text

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 531 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • namx3249N Offline
      namx3249
      last edited by

      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

      Alan KilbornA mpheathM 2 Replies Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @namx3249
        last edited by

        @namx3249

        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

        1 Reply Last reply Reply Quote 6
        • namx3249N Offline
          namx3249
          last edited by

          oh yes, you’re right (as usual)

          thanks you for the tip! all the best

          1 Reply Last reply Reply Quote 1
          • mpheathM Offline
            mpheath @namx3249
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • namx3249N Offline
              namx3249
              last edited by namx3249

              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

              1 Reply Last reply Reply Quote 1

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors