Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Check-in [a30ddba7a7]

Overview
Comment:Removed some negotation headers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a30ddba7a72667d7afa3c6a904a02085ccfc1e7b
User & Date: mario on 2014-07-31 01:14:44
Other Links: manifest | tags
Context
2014-07-31
01:14
Shorter YT urls. check-in: 883ba616fa user: mario tags: trunk
01:14
Removed some negotation headers check-in: a30ddba7a7 user: mario tags: trunk
01:13
PLUGIN DISABLED Reads out streams now (grouping wrong), but even with session ID there's no playback of manually construed URLs. check-in: 0045ccdb36 user: mario tags: trunk
Changes

Modified ahttp.py from [154714b751] to [31cf3bd93f].

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61


# prepare default query object
session = requests.Session()
# default HTTP headers for requests
session.headers.update({
    "User-Agent": "streamtuner2/2.1 (X11; U; Linux AMD64; en; rv:1.5.0.1) like WinAmp/2.1",
    "Accept": "*/*;q=0.5, audio/*, video/*, json/*, url/*",
    "Accept-Language": "en-US,en,de,es,fr,it,*;q=0.1",
    "Accept-Encoding": "gzip,deflate",
    "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.1",
    "Keep-Alive": "115",
    "Connection": "close",
    "Pragma": "no-cache",
    "Cache-Control": "no-cache",
})



#-- Retrieve data via HTTP
#
#  Well, it says "get", but it actually does POST and AJAXish GET requests too.







|

|
|
<
<
<
<







40
41
42
43
44
45
46
47
48
49
50




51
52
53
54
55
56
57


# prepare default query object
session = requests.Session()
# default HTTP headers for requests
session.headers.update({
    "User-Agent": "streamtuner2/2.1 (X11; U; Linux AMD64; en; rv:1.5.0.1) like WinAmp/2.1",
    "Accept": "*/*",
    "Accept-Language": "en-US,en,de,es,fr,it,*;q=0.1",
    "Accept-Encoding": "gzip, deflate",
    "Accept-Charset": "UTF-8, ISO-8859-1;q=0.5, *;q=0.1",




})



#-- Retrieve data via HTTP
#
#  Well, it says "get", but it actually does POST and AJAXish GET requests too.
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    
    # read
    if post:
        r = session.post(url, params=params, headers=headers)
    else:    
        r = session.get(url, params=params, headers=headers)

    #__print__( dbg.HTTP, r.request.headers );
    #__print__( dbg.HTTP, r.headers );
            
    # result
    #progress_feedback(0.9)
    content = (r.content if binary else r.text)
    
    # finish, clean statusbar
    progress_feedback("")







|
|







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
    
    # read
    if post:
        r = session.post(url, params=params, headers=headers)
    else:    
        r = session.get(url, params=params, headers=headers)

    __print__( dbg.HTTP, r.request.headers );
    __print__( dbg.HTTP, r.headers );
            
    # result
    #progress_feedback(0.9)
    content = (r.content if binary else r.text)
    
    # finish, clean statusbar
    progress_feedback("")