Every municipality and every county court are hereby empowered and authorized to grant an exclusive or nonexclusive franchise to any person. No franchise, however, shall hereafter be granted by the governing body of any municipality or by the county court of any county where the application for such franchise has not been filed, with the recorder of such municipality or the clerk of such county court, at least thirty days prior to the time when it is to be acted upon by such governing body or county court, and where notice of such application, stating the object of such franchise, has not been given by publication thereof as a Class II legal advertisement in compliance with the provisions of article three, chapter fifty-nine of this code, for which publication the publication area shall be the municipality or the county, as the case may be, wherein such franchise is to be granted. No such franchise shall be granted within thirty days after the application has been filed, nor until an opportunity has been given any person interested in the granting or refusing of such franchise to be heard. No such franchise shall hereafter be granted by any municipality or county court for a longer term than fifty years: Provided, That nothing in this section shall prevent the renewal of any such franchise for a term not exceeding fifty years, when the same shall have expired. No such franchise hereafter granted for any longer term than fifty years shall be of any force or validity. Notwithstanding the provisions of this article or any other provisions of this chapter, other general law or any charter, the failure or inability of any person to obtain from any municipality or county court a franchise for the rendering of a public service shall in no way whatever affect the power and authority granted to, and the duties and obligations imposed upon, such person under the provisions of chapter twenty-four of this code or by the Public Service Commission.