The contribution of the direct radiative capture of protons by 10B and 24Mg nuclei at low energies to the astrophysical S-factors in the reactions 10B(p,γ)11C and 24Mg(p,γ)25Al have been calculated within the R-matrix formalism by using empirical proton asymptotical normalization coefficients (ANC). The ANCs for bound proton configurations {10B+p} and {24Mg+p} were obtained from the analysis of the reactions (3He, d). The ANCs were also estimated from the values of the neutron ANCs in the mirror nucleus 25Mg following the suggestion that the neutron and the proton in the mirror states have equivalent nuclear potentials. It has been found that the S-factor for the reaction 10B(p,γ)11C extrapolated to zero energy contributes ~100 keV b to the radiative capture to the ground state of 11C. For the reaction 24Mg(p,γ)25Al the value S(0) gives 58 keV b with a direct capture contribution of 41 keV b.