Ok, you have a external Timemachine drive that has failed and you want to extract just the iTunes and iPhoto Library.
It depends upon the level of failure.
1: If the internal drive inside the external drive case is mechanically dead, then it's thousands of dollars for platter recovery service. Drive Savers for instance. A no go if the drive was encrypted.
1.5 If the internal drive works, it can be removed and a SATA to USB adapter used, and then depending upon other factors below...
2: If the internal/external drive is working mechanically and there is a software, bad sector(s) or file structure problem that it can't be accessed by TimeMachine on a Mac, and if it's not encrypted, then either a seasoned local data recovery specialist or you can access the drive using special software like Data Rescue on another Mac to read the 1's and 0's of the bits themselves, which it figures it out and recreates the files again.
I've seen this done and it's a big mess of files, many of them have the same names, but many have no data as they are only placeholders in the individual states TimeMachine saves. A lot of work, but it can be done. You will get all the files recovered, and have to sift through them yourself, the local date recovery service won't do this.
3: If you don't have another Mac, then find a friend who will use Migration Assistant on their Mac to transfer your files and give you a copy on a external drive.