This is a pretty fast pattern in A phrygian dominant which works well over many different grooves.
This lick is mostly in A phrygian dominant scale which is the 5th mode of D harmonic minor. I said mostly because you will find a minor 3rd in a couple of places (in the 1st bar). That note doesn't belong to the scale but it is a part of a strong unit so in this case it works well. You can replace that note with the major 3rd if you like (C#) but it will just be a bigger stretch for you.
The difficult thing here is the picking. Every 1st of the 6 note group is a down stroke and every 6th (the last) of the 6 note group is an up stroke. Everything in between is legato (hammer on and pull off). Everything is marked clearly in the Guitar Pro file.
You can make a lick out of any scale using this same pattern. It is very easy to figure out the notes. You can also make your own backing track and change the chords in every bar while playing this exact same melody. Try this: Dm, Edim7, Gm, A7 and back to Dm. It will all work.
Practice slowly, experiment and enjoy