Youden index from roc_curve

I am trying to get Youden index from my learner, in order to get optimal threshold value. I am unable to reach a conclusive end till now. One way is to calculate it but for that we need specificity which is again seems to be un-available in metrics. Any suggestions are welcome as long as it doesn’t require to calculate Youden index from my test dataset during inference.