Recherche avancée

Médias (91)

Autres articles (31)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (6420)

  • Why doesn't seem to be able to send an audio file with FRONT_COVER on the Pytelegrambotapi

    27 décembre 2024, par exorik

    In general the problem is that the audio file is sent to a file without a picture. I first thought that the problem is that the picture is installed on the wrong version of id3, and tried four methods of installation

    


      

    1. via the ffmpeg command = [ “ffmpeg”, “-i”, file_path, “-i”, cover_path, “-map”, “0”, “-map”, “1”, “-c:a”, “copy”, “-c:v”, “mjpeg”, “-id3v2_version”, “3“,”-y”, output_file, ]subprocess.run(command, check=True)

      


    2. 


    3. via eyed3, audiofile.tag.images.set(
eyed3.id3.frames.ImageFrame.FRONT_COVER,
cover_data,
“` image/jpeg,
)

      


    4. 


    5. through the mutagen library, tried setting audio.add(
APIC(
encoding=3,
mime=“image/jpeg”,
type=3,
desc=“Cover”,
data=open(saved_photo, “rb”).read(),
)
)
At this stage I realized that the problem is not in the correct id3 tag setting, but in the method through which the audio file is sent. because if I opened it manually and sent it, the cover was there.
But I also tried installing the tag. second version. through the eyed3 library, but that also didn't result in the audio file with the cover art being sent to telegram.

      


    6. 


    


    audiofile w/ out cover

    


    and the exact same audio file, only with the cover art. (it hasn't been altered in any way)

    


    


user_states = {}




def save_audio(message):
    file_info = bot.get_file(message.audio.file_id)
    downloaded_file = bot.download_file(file_info.file_path)

    user_dir = os.path.join("TEMP", str(message.chat.id), "albums")
    os.makedirs(user_dir, exist_ok=True)

    original_file_name = (
        message.audio.file_name
        if message.audio.file_name
        else f"{message.audio.file_id}.mp3"
    )

    file_path = os.path.join(user_dir, original_file_name)

    if message.chat.id not in user_states:
        user_states[message.chat.id] = {"files": [], "stage": None}

    with open(file_path, "wb") as f:
        f.write(downloaded_file)

    user_states[message.chat.id]["files"].append(file_path)

    return file_path


def clear_metadata_for_file(file_path, user_id):
    clear_metadata = settings.get(str(user_id), {}).get("clear", True)

    if clear_metadata:
        temp_file_path = f"{file_path}.temp.mp3"
        command = [
            "ffmpeg",
            "-i",
            file_path,
            "-map_metadata",
            "-1",
            "-c:a",
            "copy",
            "-y",
            temp_file_path,
        ]
        subprocess.run(command, check=True)
        os.replace(temp_file_path, file_path)

        audio_file = eyed3.load(file_path)
        if audio_file.tag is not None:
            audio_file.tag.clear()
        audio_file.tag.save()

    else:
        return file_path


def send_files(message):
    chat_id = message.chat.id
    if chat_id not in user_states or "files" not in user_states[chat_id]:
        return "No files found"

    for file_path in user_states[chat_id]["files"]:
        try:
            with open(file_path, "rb") as f:
                bot.send_audio(chat_id, f)
        except Exception as e:
            return e



@bot.message_handler(content_types=["photo"])
def handle_cover(message):

    if message.content_type == "photo":
        try:

            saved_photo = save_photo(message)


            for file_path in user_states[message.chat.id]["files"]:

                audio = ID3(file_path)
                audio.add(
                    APIC(
                        encoding=3,
                        mime="image/jpeg",
                        type=3,
                        desc="Cover",
                        data=open(saved_photo, "rb").read(),
                    )
                )
                audio.save(file_path)
                with open(saved_photo, "rb") as image_file:
                    image_data = image_file.read()

                audiofile = eyed3.load(file_path)

                if audiofile.tag is None:
                    audiofile.initTag(version=(2, 3, 0))

                audiofile.tag.images.set(
                    3, image_data, "image/jpeg", description="Cover"
                )
                audiofile.tag.save(version=(2, 3, 0))

            send_files(message)

        except Exception as e:
            return

bot.infinity_polling()



    


    I was hoping to get some audio files with cover art, and I'm sure there's no problem with that. But for some reason, the file itself is sent visually without the cover art. I'd really appreciate it if you could help me out with this.

    


  • Piwik 1.12, New Features, API Improvements, Stability — The Last Piwik 1.X Release

    30 mai 2013, par Piwik team — Development

    We are very excited to announce the immediate availability of Piwik v1.12 !

    Piwik v1.12 is a major new release with four big new features, seven smaller new features, several API improvements and all together 82 tickets fixed. This is also the last major 1.X release, which means after this release we will be working on releasing Piwik 2.0. This also means that you should upgrade to PHP 5.3 or higher if you haven’t already, since Piwik 2.0 will only support PHP 5.3 and above.

    Finally, this release contains two breaking changes to the API. If you use the Piwik API click here or scroll down to see if you’re affected.

    Table of Contents :

    New Big Feature – Beta Release Channel

    beta_channel_settings

    For those of you who want to help test Piwik 2.0-beta releases as soon as they come up, we’ve made it easier to use our beta releases. Navigate to the Settings > General Settings page and click the The latest beta release radio button. You will then be able to upgrade to beta releases.

    This isn’t truly a major feature, but we think it’s just as important because it will allow us to create more beta releases and thus catch more bugs before we make a final release. This means more releases and more stability for you.

    New Big Feature – Segment Editor

    Custom Segment Editor with Custom Variable segmentation

    The Segment Editor is a long-awaited new feature that allows you to view, save and edit your segments.

    Piwik has supported segmentation (filtering visits and reports by arbitrary criteria, like browser family) for quite some time now, but it has never been possible to visually create and modify them. Nor could they be saved for later recall.

    Thanks to the eighty individuals and company who funded this feature, it is now possible to :

    • visually segment your visitors, instead of creating URLs.
    • save segments and easily switch between them, instead of remembering URLs.
    • get suggestions for segments that might be helpful to view.
    • learn more in the Segmentating Analytics reports user documentation..

    New Big Feature – Page Speed Reports

    You can now see how long it took your webserver to generate and send pages over HTTP through the new Avg. Generation Time metric.

    This metric can be viewed on both the Pages and Page Titles reports :

    avg_generation_time_page_urls

    And the average page generation time for all the pages in your website/webapp is displayed on the visitors overview :

    avg_generation_time_overview

    You can use this new information to benchmark your webapp and web server.

    New Big Feature – Device Detection Reports

    Piwik 1.12 also includes a new plugin that provides reports on the device types (tablet, desktop, smartphone, etc.), device brands (Apple, Google, Samsung, etc.) and device models (iPad, Nexus 7, etc.) your visitors use to access your website :

    device_reports

    The new plugin also enhances Operating system detections (detecting sub versions of Linux, Windows, and more).

    Note : This plugin is not enabled by default, but will be in Piwik 2.0. If you want to view these reports now, you can activate the plugin in the Installed Plugins admin page. Navigate to Visitors > Devices to see the new reports. You may also use the new (beta) ‘Device type’.

    The new plugin was developed with the support of Clearcode.cc our technology partner

    Other improvements

    Majestic SEO Metrics

    seo_stats_with_majestic

    We’ve added two new SEO metrics to the SEO widget, both of which are calculated by MajesticSEO.com. These metrics will tell you the number of external backlinks (the number of links to your site from other sites) and the number of referrer domains (the number of domains that link to your site).

    We thank the team at Majestic for their support and hard work in bringing you these metrics to your Piwik dashboards !

    Real-time Visitor Count Dashboard Widget

    Real time visitor counter

    There is now a simple new widget you can use to see the number of visitors, visits and actions that occurred in the last couple minutes. We call it the Real Time Visitor Counter !

    New segment parameter : siteSearchKeyword.

    There is now a new segment parameter you can use to segment your visits : siteSearchKeyword. This parameter will let you select visits that had site searches with a specific keyword.

    Ignore URL letter case when importing log files.

    We’ve added a new option to the log import script, –force-lowercase-path. When used, the importer will change URL paths to lowercase before tracking them. This way http://domain.com/MY/BLOG will be treated the same as http://domain.com/my/blog.

    Updated ISP Names

    pretty_provider_names

    We’ve also modified the Providers report so prettier and more up-to-date names of ISPs are displayed.

    Customize the background/text/axis color of graphs.

    custom_image_graph_colors

    It is now possible to change the background color, text color and/or axis color of the graph images generated by the ImageGraph plugin. To access this functionality, use the following URL query parameters when generating an image :

    • backgroundColor
    • textColor
    • axisColor

    For example :

    http://demo.piwik.org/index.php?module=API&method=ImageGraph.get&idSite=7&apiModule=UserSettings&apiAction=getBrowser&token_auth=anonymous&period=day&date=2013-03-21,2013-04-19&language=en&width=779&height=150&fontSize=9&showMetricTitle=0&aliasedGraph=1&legendAppendMetric=0&backgroundColor=efefef&gridColor=dcdcdc&colors=cb2026

    Send your users to a custom URL after they logout.

    If you manage a Piwik installation with many users and you want to send them to a custom page or website after they log out of Piwik, you can now specify the URL to redirect users after they log out.

    API Changes and Improvements

    BREAKING CHANGE – renamed segment parameters.

    The following segment parameters have been renamed :

    • continent renamed to : continentCode
    • browserName renamed to : browserCode
    • operatingSystem renamed to : operatingSystemCode
    • lat renamed to : latitude
    • long renamed to : longitude
    • region renamed to : regionCode
    • country renamed to : countryCode
    • continent renamed to : continentCode

    If you use one of the old segment parameter names, Piwik will throw an exception, so you should notice when you’re using an old name.

    BREAKING CHANGE – changes to the input & output of the Live.getLastVisitsDetails method.

    The following changes were made to the Live.getLastVisitsDetails API method :

    • The method no longer uses the maxIdVisit query parameter. It has been replaced by the filter_offset parameter.
    • Site search keywords are now displayed in a <siteSearchKeyword> element. They were formerly in <pageTitle> elements.
    • Custom variables with page scope now have ‘Page’ in their element names when displayed. For example, <customVariablePageName1>, <customVariablePageName2>, etc.

    Filter results of MultiSites.getAll by website name.

    It is now possible to filter the results of MultiSites.getAll by website name. To do this, set the pattern query parameter to the desired regex pattern.

    Get suggested values to use for a segment parameter.

    The new API method API.getSuggestedValuesForSegment can now be used to get suggested values for a segment parameter. This method will return a list of the most seen values (in the last 60 days) for a certain segment parameter. So for browserCode, this would return the codes for the browsers most visitors used in the last 60 days.

    Use extra tracking query parameters with the JS tracker (such as ‘lat’ & ‘long’).

    We’ve added a new method to the JavaScript tracker named appendToTrackingUrl. You can use this method to add extra query parameters to a tracking request, like so :

    _paq.push(['appendToTrackingUrl', 'lat=X&amp;long=Y']);

    What we’re working on

    As we said above, Piwik v1.12 is the last in the 1.X series of releases. This means we are now officially working on Piwik 2.0.

    Piwik 2.0 will be a big release, to be sure, but it’s going to bring you more than just a couple new features and a bag of bug fixes. For Piwik 2.0 we will be revisiting the user needs and the ideals that originally prompted us to create Piwik in order to build our vision of the future of web analytics.

    Piwik 2.0 won’t just be a bigger, better web app, but a new platform for observing and analyzing the things that matter to you.

    Participate in Piwik

    Are you a talented developer or an experienced User Interface designer ? Or maybe you like to write documentation or are a marketing guru ?

    If you have some free time and if you want to contribute to one of the most awesome open source projects around, please get in touch with the Piwik team, or read this page to learn more…

    Summary

    For the full list of changes in Piwik 1.12 check out the Changelog.

    Thank you to the core developers, all the beta testers and users, our official supporters, the translators & everyone who reported bugs or feature requests. Also thank you to softwares we use, and the libraries we use.

    If you are a company and would like to help an important project like Piwik grow, please get in touch, it means a lot to us. You can also participate in the project

    –> if you like what you read, please tell your friends and colleagues or write on your website, blog, forums, stackoverflow, etc. <–

    Peace. Enjoy !

  • Easily track Events within Matomo Analytics thanks to Matomo Tag Manager

    7 juin 2019, par Matomo Core Team — Analytics Tips

    Easily track Events within Matomo Analytics thanks to Matomo Tag Manager

    Introduction

    In this article we’ll cover what events in Matomo Analytics are ; and how you can easily set them up thanks to Matomo Tag Manager.

    Key concepts within this article

    • Events
    • Quick definition of the Tag Management System
    • Matomo config
    • Creating triggers
    • Variables

    What are events in Matomo Analytics and why are they useful ?

    Events allow you to measure interactions on your website which are not defined by default. With them you can measure clicks on some elements of a page, such as, how visitors are interacting with dropdown menus, media players, scrolling behaviours etc. You can also use them to define goals which make them a key feature in Matomo Analytics. Learn more about tracking events in Matomo.

    You can easily access the Events report in Matomo Analytics by clicking on the Behaviour category :

    Matomo tag manager event tracking

    And you may read the following message and feel a bit frustrated :

    Matomo tag manager event tracking

    “There is no data for this report” is a nice way to say, “Hey, you are tracking just a tiny part of what Matomo Analytics can do for you.”

    Matomo is a great software, but it can’t guess what you want to track.

    In order for Matomo to register those event tracking interactions, you’ll need to explain it by adding a line of code similar to this one when the interaction happens :

     

    _paq.push(['trackEvent', 'Here you enter whatever you want', 'Here too', 'and here also']);

     

    Let’s imagine you want to track a click on an HTML button, your code will look something similar to this at the moment of the interaction :

    As you can imagine, two main challenges will arise for non developers :

    1. How to access the source code ?
    2. How to define the interaction ?

    Luckily, Matomo Tag Manager makes those steps easy for you. Let’s see how the same tracking is implemented with Matomo Tag Manager.

    A quick definition of what Matomo Tag Manager is

    Matomo Tag Manager lets you manage all your tracking and marketing tags in one easy-to-access place. Please visit this page to learn more about Matomo Tag Manager. In order to start using it, you’ll need to copy/paste a tracking code, named a “container”, within the section of your pages.

    Once the container is on your website, all you need to do is to follow these simple steps :

    1. Add a Matomo Tag.
    2. Assign the condition to fire the tag (what we call the trigger).
    3. Publish your work.
    4. And enjoy

    1 – Add a Matomo Event tracking code

    All you have to do here is click on “CREATE NEW TAG”

    Matomo tag manager event tracking

    Once selected, just mention how you’d like this tag to be named (it is for your internal purpose here so always use an explicit tag name) and the Matomo configuration (the default configuration setting will be fine in most of the cases) :

    Matomo tag manager event tracking

    Then Matomo Tag Manager will ask you the type of tracking you’d like to deploy, in this case, this is an event so select “Event” :

    Matomo tag manager event tracking

    Then all you need is to indicate the values you’d like to push through your event :

    Matomo tag manager event tracking

    To put it in perspective, all we did here through Matomo Tag Manager was implement the equivalent of the following line of code :

    _paq.push(['trackEvent', 'Element interactions', 'Click button', 'Click Me']);

    Let’s now see how can we do this on click code part which we call a trigger.

    2 – Assign the condition to fire the tag

    In order to execute the event we’ll need to define when it will happen. You do this by clicking on Create a new trigger now :

    Matomo tag manager event tracking

    As the interaction we’d like to track is happening when a click occurs, it will be a click trigger, and as our button is not a link, we’ll select All Elements Click :

    Matomo tag manager event tracking

    Once selected you’ll need to be precise on the condition in which the event will be triggered. In this case we do not want to have events pushed every time someone is clicking on something on our website. We only want to track when they click on this specific button. That’s the reason why our trigger is set to fire only when the click occurs on an element which has an id and has the value “cta” :

    Once you click on the green button named CREATE NEW TRIGGER, you validate the tag by clicking on CREATE NEW TAG :

    Matomo tag manager event tracking
    Matomo tag manager event tracking

    Then you can move to the last part.

    3 – Publish your work

    Tag Managers are very powerful as they allow you to easily execute any JavaScript code, CSS or even text content on your websites.

    That’s why when you create your tag it doesn’t go live straight away on your website. In order to do this you need to publish your tag and this is what the “Publish” category is designed for :

    Matomo tag manager event tracking

    After that, click on the second button if you’re confident your tag and trigger are both ready to go live :

    Matomo event tracking tag manager

    4 – Enjoy

    Well done. As your tag is now live, every click made on this button will now be pushed to your Matomo Analytics account within :

    1. The visitor log report :

    Matomo event tracking tag manager

    2. The events report :

    Matomo event tracking tag manager

    You may now be asking, “That’s great, but can I collect something more exciting than clicks ?” 

    Of course you can ! This is what the Matomo Tag Manager is all about.

    As long as you can express it through a trigger you can really push whatever you want to Matomo Analytics. You can track scrolling patterns, an element visible on the page like an image, an ad or the time spent on the page. The options are now open to you with Tag Manager.

    Give them a try ! Change the triggers, start playing around with variables and discover that the possibilities are endless.

    Happy analytics,
    Matomo team