Smart Rule update thumbnail Youtube video

Hi, I try to make a smart rule with the AppleScript to update the thumbnail of YouTube video bookmarks with the thumbnail obtained on YouTube, but not all bookmarks are updated. I do not have experience with AppleScript. I just want to know if there is better way to do this.

on performSmartRule(theRecords)
	tell application id "DNtp"
		repeat with theRecord in theRecords
			set theURL to URL of theRecord as string
			set splitCharacter to "&"
			set splitOffset to (offset of splitCharacter in theURL) + (count splitCharacter) - 2
			set theURLnew to texts 1 thru splitOffset of theURL
			-- set URL to theRecord to theURLnew
			set theReverse to reverse of text items of theURLnew as string
			set theReverseID to texts 1 thru 11 of theReverse
			set theID to reverse of text items of theReverseID as string
			set theThumbnail to "http://img.youtube.com/vi/" & theID & "/hqdefault.jpg"
			set thumbnail of theRecord to theThumbnail
		end repeat
	end tell
end performSmartRule

Please post the URL of a problematic video so that we can try to reproduce & check this on our own. Thank you!