How to disable warning about listening at high volume for a long time
According to the article How to Automatically Disable the High Volume Warning without Root, the warning is implemented on devices due to European legislation which stipulates that:

all electronic devices capable of media playback sold after February 2013 must have a default output volume level of a maximum 85 dB. Users can choose to override the warning to increase the volume to a maximum of 100 dB, but in doing so the warning must re-appear after 20 hours of music playback.

(The warning should only appear if your device is using an European ROM)
It is possible to disable the warning by following the methods below:

On rooted devices

If you have the Xposed framework installed, there are several modules (VolumeSteps+ (image on the left), NoSafeVolumeWarning, GravityBox (image on the right), etc) that offer the option to disable the warning.



On non-rooted devices

The article above describes methods for disabling the warning using Tasker &amp; AutoTools
either at boot or periodically. It also has a link to download the Tasker's scripts.
In other forums, the app Hearing Saver is purported to work on non-rooted devices.
You can also go to Settings --&gt; Apps --&gt; Your_App --&gt; Notifications --&gt; enable Block Notifications
Note: I don't use Tasker that is why I have not included the process decribed in the article. However, those who are more knowledgeable with it can include the steps.