from flask import Flask, request, jsonify
app = Flask(__name__)
# Mock database of BBC Earth content
bbc_earth_content = 
    "channel1": "https://example.com/bbc-earth-channel1.m3u8",
    "program1": "https://example.com/bbc-earth-program1.m3u8"
@app.route('/get_m3u8_link', methods=['GET'])
def get_m3u8_link():
    content_id = request.args.get('content_id')
    if content_id in bbc_earth_content:
        return jsonify("m3u8_link": bbc_earth_content[content_id])
    else:
        return jsonify("error": "Content not found"), 404
if __name__ == '__main__':
    app.run(debug=True)

Broadcasters like BBC (through its commercial arm, BBC Studios) use sophisticated anti-piracy measures. The M3U8 links for their geo-fenced and subscription-based channels refresh every few minutes. By the time someone posts a link online, it is already invalid.

You do not need a live channel. You can purchase or rent specific series like Prehistoric Planet (Apple TV+) or buy episodes of Blue Planet via Amazon Prime Video. This is often cheaper than a monthly TV subscription.

In countries like Singapore, South Africa, and Hong Kong, BBC Player is available as an add-on subscription. It includes a live stream of the BBC Earth channel and on-demand access to hundreds of documentaries.